1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // type_traits 11 12 // is_move_assignable 13 14 #include <type_traits> 15 16 template <class T> test_is_move_assignable()17void test_is_move_assignable() 18 { 19 static_assert( std::is_move_assignable<T>::value, ""); 20 } 21 22 template <class T> test_is_not_move_assignable()23void test_is_not_move_assignable() 24 { 25 static_assert(!std::is_move_assignable<T>::value, ""); 26 } 27 28 class Empty 29 { 30 }; 31 32 class NotEmpty 33 { 34 public: 35 virtual ~NotEmpty(); 36 }; 37 38 union Union {}; 39 40 struct bit_zero 41 { 42 int : 0; 43 }; 44 45 struct A 46 { 47 A(); 48 }; 49 main()50int main() 51 { 52 test_is_move_assignable<int> (); 53 test_is_move_assignable<A> (); 54 test_is_move_assignable<bit_zero> (); 55 test_is_move_assignable<Union> (); 56 test_is_move_assignable<NotEmpty> (); 57 test_is_move_assignable<Empty> (); 58 59 #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES 60 test_is_not_move_assignable<const int> (); 61 test_is_not_move_assignable<int[]> (); 62 test_is_not_move_assignable<int[3]> (); 63 #endif 64 test_is_not_move_assignable<void> (); 65 } 66