1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // is_nothrow_assignable
14 #include <type_traits>
15 #include "test_macros.h"
17 template <class T, class U>
18 void test_is_nothrow_assignable()
20 static_assert(( std::is_nothrow_assignable<T, U>::value), "");
22 static_assert(( std::is_nothrow_assignable_v<T, U>), "");
26 template <class T, class U>
27 void test_is_not_nothrow_assignable()
29 static_assert((!std::is_nothrow_assignable<T, U>::value), "");
31 static_assert((!std::is_nothrow_assignable_v<T, U>), "");
46 void operator=(C&); // not const
51 test_is_nothrow_assignable<int&, int&> ();
52 test_is_nothrow_assignable<int&, int> ();
53 #if TEST_STD_VER >= 11
54 test_is_nothrow_assignable<int&, double> ();
57 test_is_not_nothrow_assignable<int, int&> ();
58 test_is_not_nothrow_assignable<int, int> ();
59 test_is_not_nothrow_assignable<B, A> ();
60 test_is_not_nothrow_assignable<A, B> ();
61 test_is_not_nothrow_assignable<C, C&> ();