2010-05-11 21:42:16 +02:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
2010-05-11 23:36:01 +02:00
|
|
|
// The LLVM Compiler Infrastructure
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
2010-11-16 23:09:02 +01:00
|
|
|
// This file is dual licensed under the MIT and the University of Illinois Open
|
|
|
|
// Source Licenses. See LICENSE.TXT for details.
|
2010-05-11 21:42:16 +02:00
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
// type_traits
|
|
|
|
|
|
|
|
// has_copy_assign
|
|
|
|
|
|
|
|
#include <type_traits>
|
|
|
|
|
2010-09-08 19:55:32 +02:00
|
|
|
class Empty
|
|
|
|
{
|
|
|
|
};
|
|
|
|
|
|
|
|
class NotEmpty
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~NotEmpty();
|
|
|
|
};
|
|
|
|
|
|
|
|
union Union {};
|
|
|
|
|
|
|
|
struct bit_zero
|
|
|
|
{
|
|
|
|
int : 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct A
|
|
|
|
{
|
|
|
|
A();
|
|
|
|
};
|
|
|
|
|
2010-05-11 21:42:16 +02:00
|
|
|
int main()
|
|
|
|
{
|
2010-09-08 19:55:32 +02:00
|
|
|
static_assert(( std::has_copy_assign<int>::value), "");
|
|
|
|
static_assert((!std::has_copy_assign<const int>::value), "");
|
|
|
|
static_assert((!std::has_copy_assign<int[]>::value), "");
|
|
|
|
static_assert((!std::has_copy_assign<int[3]>::value), "");
|
|
|
|
static_assert((!std::has_copy_assign<int&>::value), "");
|
|
|
|
static_assert(( std::has_copy_assign<A>::value), "");
|
|
|
|
static_assert(( std::has_copy_assign<bit_zero>::value), "");
|
|
|
|
static_assert(( std::has_copy_assign<Union>::value), "");
|
|
|
|
static_assert(( std::has_copy_assign<NotEmpty>::value), "");
|
|
|
|
static_assert(( std::has_copy_assign<Empty>::value), "");
|
2010-05-11 21:42:16 +02:00
|
|
|
}
|