More of P0006R0: type traits variable aliases for C++17.

llvm-svn: 252406
This commit is contained in:
Marshall Clow 2015-11-07 17:44:36 +00:00
parent e02bcdca88
commit 8be59af1ed
27 changed files with 354 additions and 5 deletions

View File

@ -1378,6 +1378,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY has_virtual_destructor
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool has_virtual_destructor_v
= has_virtual_destructor<_Tp>::value;
#endif
// alignment_of
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
@ -1905,12 +1910,22 @@ template <class _Tp, class _Arg>
struct is_assignable
: public __is_assignable_imp<_Tp, _Arg> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_assignable_v
= is_assignable<_Tp, _Arg>::value;
#endif
// is_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_assignable_v
= is_copy_assignable<_Tp>::value;
#endif
// is_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
@ -1921,6 +1936,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_move_assignable
: public is_copy_assignable<_Tp> {};
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_assignable_v
= is_move_assignable<_Tp>::value;
#endif
// is_destructible
// if it's a reference, return true
@ -1979,6 +1999,11 @@ template <>
struct is_destructible<void>
: public _VSTD::false_type {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_destructible_v
= is_destructible<_Tp>::value;
#endif
// move
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -3013,6 +3038,11 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // __has_feature(is_constructible)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_constructible_v
= is_constructible<_Tp, _Args...>::value;
#endif
// is_default_constructible
template <class _Tp>
@ -3020,6 +3050,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
: public is_constructible<_Tp>
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_default_constructible_v
= is_default_constructible<_Tp>::value;
#endif
// is_copy_constructible
template <class _Tp>
@ -3027,6 +3062,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
: public is_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_copy_constructible_v
= is_copy_constructible<_Tp>::value;
#endif
// is_move_constructible
template <class _Tp>
@ -3038,6 +3078,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
#endif
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_move_constructible_v
= is_move_constructible<_Tp>::value;
#endif
// is_trivially_constructible
#ifndef _LIBCPP_HAS_NO_VARIADICS
@ -3165,18 +3210,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_constructible_v
= is_trivially_constructible<_Tp>::value;
#endif
// is_trivially_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible
: public is_trivially_constructible<_Tp>
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_default_constructible_v
= is_trivially_default_constructible<_Tp>::value;
#endif
// is_trivially_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_constructible
: public is_trivially_constructible<_Tp, typename add_lvalue_reference<const _Tp>::type>
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_constructible_v
= is_trivially_copy_constructible<_Tp>::value;
#endif
// is_trivially_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructible
@ -3187,6 +3247,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_constructibl
#endif
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_constructible_v
= is_trivially_move_constructible<_Tp>::value;
#endif
// is_trivially_assignable
#if __has_feature(is_trivially_assignable) || _GNUC_VER >= 501
@ -3225,12 +3290,22 @@ struct is_trivially_assignable<_Tp&, _Tp&&>
#endif // !__has_feature(is_trivially_assignable)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_trivially_assignable_v
= is_trivially_assignable<_Tp, _Arg>::value;
#endif
// is_trivially_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_copy_assignable
: public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_copy_assignable_v
= is_trivially_copy_assignable<_Tp>::value;
#endif
// is_trivially_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
@ -3242,6 +3317,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_move_assignable
#endif
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_move_assignable_v
= is_trivially_move_assignable<_Tp>::value;
#endif
// is_trivially_destructible
#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403)
@ -3263,6 +3343,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_destructible<_Tp[
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_trivially_destructible_v
= is_trivially_destructible<_Tp>::value;
#endif
// is_nothrow_constructible
#if 0
@ -3423,18 +3508,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS
#endif // __has_feature(is_nothrow_constructible)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES) && !defined(_LIBCPP_HAS_NO_VARIADICS)
template <class _Tp, class ..._Args> _LIBCPP_CONSTEXPR bool is_nothrow_constructible_v
= is_nothrow_constructible<_Tp, _Args...>::value;
#endif
// is_nothrow_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
: public is_nothrow_constructible<_Tp>
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_default_constructible_v
= is_nothrow_default_constructible<_Tp>::value;
#endif
// is_nothrow_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
: public is_nothrow_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::type> {};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_constructible_v
= is_nothrow_copy_constructible<_Tp>::value;
#endif
// is_nothrow_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
@ -3445,6 +3545,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_constructible
#endif
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_move_constructible_v
= is_nothrow_move_constructible<_Tp>::value;
#endif
// is_nothrow_assignable
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
@ -3513,6 +3618,11 @@ struct is_nothrow_assignable<_Tp&, _Tp&&>
#endif // __has_feature(cxx_noexcept)
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp, class _Arg> _LIBCPP_CONSTEXPR bool is_nothrow_assignable_v
= is_nothrow_assignable<_Tp, _Arg>::value;
#endif
// is_nothrow_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_assignable
@ -3530,6 +3640,11 @@ template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_move_assignable
#endif
{};
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_copy_assignable_v
= is_nothrow_copy_assignable<_Tp>::value;
#endif
// is_nothrow_destructible
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
@ -3591,6 +3706,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[]>
#endif
#if _LIBCPP_STD_VER > 14 && !defined(_LIBCPP_HAS_NO_VARIABLE_TEMPLATES)
template <class _Tp> _LIBCPP_CONSTEXPR bool is_nothrow_destructible_v
= is_nothrow_destructible<_Tp>::value;
#endif
// is_pod
#if __has_feature(is_pod) || (_GNUC_VER >= 403)

View File

@ -20,6 +20,12 @@ void test_has_virtual_destructor()
static_assert( std::has_virtual_destructor<const T>::value, "");
static_assert( std::has_virtual_destructor<volatile T>::value, "");
static_assert( std::has_virtual_destructor<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::has_virtual_destructor_v<T>, "");
static_assert( std::has_virtual_destructor_v<const T>, "");
static_assert( std::has_virtual_destructor_v<volatile T>, "");
static_assert( std::has_virtual_destructor_v<const volatile T>, "");
#endif
}
template <class T>
@ -29,6 +35,12 @@ void test_has_not_virtual_destructor()
static_assert(!std::has_virtual_destructor<const T>::value, "");
static_assert(!std::has_virtual_destructor<volatile T>::value, "");
static_assert(!std::has_virtual_destructor<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::has_virtual_destructor_v<T>, "");
static_assert(!std::has_virtual_destructor_v<const T>, "");
static_assert(!std::has_virtual_destructor_v<volatile T>, "");
static_assert(!std::has_virtual_destructor_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -26,12 +26,18 @@ template <class T, class U>
void test_is_assignable()
{
static_assert(( std::is_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert( std::is_assignable_v<T, U>, "");
#endif
}
template <class T, class U>
void test_is_not_assignable()
{
static_assert((!std::is_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert( !std::is_assignable_v<T, U>, "");
#endif
}
struct D;

View File

@ -38,30 +38,45 @@ template <class T>
void test_is_constructible()
{
static_assert( (std::is_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert( std::is_constructible_v<T>, "");
#endif
}
template <class T, class A0>
void test_is_constructible()
{
static_assert( (std::is_constructible<T, A0>::value), "");
static_assert(( std::is_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_constructible_v<T, A0>), "");
#endif
}
template <class T, class A0, class A1>
void test_is_constructible()
{
static_assert( (std::is_constructible<T, A0, A1>::value), "");
static_assert(( std::is_constructible<T, A0, A1>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_constructible_v<T, A0, A1>), "");
#endif
}
template <class T>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_constructible_v<T>), "");
#endif
}
template <class T, class A0>
void test_is_not_constructible()
{
static_assert((!std::is_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_constructible_v<T, A0>), "");
#endif
}
int main()

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_copy_assignable()
{
static_assert(( std::is_copy_assignable<T>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_copy_assignable_v<T>), "");
#endif
}
template <class T>
void test_is_not_copy_assignable()
{
static_assert((!std::is_copy_assignable<T>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_copy_assignable_v<T>), "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_copy_constructible()
{
static_assert( std::is_copy_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_copy_constructible_v<T>, "");
#endif
}
template <class T>
void test_is_not_copy_constructible()
{
static_assert(!std::is_copy_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_copy_constructible_v<T>, "");
#endif
}
class Empty

View File

@ -20,6 +20,12 @@ void test_is_default_constructible()
static_assert( std::is_default_constructible<const T>::value, "");
static_assert( std::is_default_constructible<volatile T>::value, "");
static_assert( std::is_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_default_constructible_v<T>, "");
static_assert( std::is_default_constructible_v<const T>, "");
static_assert( std::is_default_constructible_v<volatile T>, "");
static_assert( std::is_default_constructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -29,6 +35,12 @@ void test_is_not_default_constructible()
static_assert(!std::is_default_constructible<const T>::value, "");
static_assert(!std::is_default_constructible<volatile T>::value, "");
static_assert(!std::is_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_default_constructible_v<T>, "");
static_assert(!std::is_default_constructible_v<const T>, "");
static_assert(!std::is_default_constructible_v<volatile T>, "");
static_assert(!std::is_default_constructible_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -22,6 +22,12 @@ void test_is_destructible()
static_assert( std::is_destructible<const T>::value, "");
static_assert( std::is_destructible<volatile T>::value, "");
static_assert( std::is_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_destructible_v<T>, "");
static_assert( std::is_destructible_v<const T>, "");
static_assert( std::is_destructible_v<volatile T>, "");
static_assert( std::is_destructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -31,6 +37,12 @@ void test_is_not_destructible()
static_assert(!std::is_destructible<const T>::value, "");
static_assert(!std::is_destructible<volatile T>::value, "");
static_assert(!std::is_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_destructible_v<T>, "");
static_assert(!std::is_destructible_v<const T>, "");
static_assert(!std::is_destructible_v<volatile T>, "");
static_assert(!std::is_destructible_v<const volatile T>, "");
#endif
}
class Empty {};

View File

@ -79,7 +79,7 @@ int main()
// In C++14, cv-void is is a literal type
#if TEST_STD_VER < 14
test_is_not_literal_type<void>();
#else TEST_STD_VER > 14
#elif TEST_STD_VER > 14
test_is_literal_type<void>();
#endif

View File

@ -16,13 +16,19 @@
template <class T>
void test_is_move_assignable()
{
static_assert( std::is_move_assignable<T>::value, "");
static_assert(( std::is_move_assignable<T>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_move_assignable_v<T>), "");
#endif
}
template <class T>
void test_is_not_move_assignable()
{
static_assert(!std::is_move_assignable<T>::value, "");
static_assert((!std::is_move_assignable<T>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_move_assignable_v<T>), "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_move_constructible()
{
static_assert( std::is_move_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_move_constructible_v<T>, "");
#endif
}
template <class T>
void test_is_not_move_constructible()
{
static_assert(!std::is_move_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_move_constructible_v<T>, "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T, class U>
void test_is_nothrow_assignable()
{
static_assert(( std::is_nothrow_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_nothrow_assignable_v<T, U>), "");
#endif
}
template <class T, class U>
void test_is_not_nothrow_assignable()
{
static_assert((!std::is_nothrow_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_nothrow_assignable_v<T, U>), "");
#endif
}
struct A

View File

@ -18,30 +18,45 @@ template <class T>
void test_is_nothrow_constructible()
{
static_assert(( std::is_nothrow_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_nothrow_constructible_v<T>), "");
#endif
}
template <class T, class A0>
void test_is_nothrow_constructible()
{
static_assert(( std::is_nothrow_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_nothrow_constructible_v<T, A0>), "");
#endif
}
template <class T>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_nothrow_constructible_v<T>), "");
#endif
}
template <class T, class A0>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_nothrow_constructible_v<T, A0>), "");
#endif
}
template <class T, class A0, class A1>
void test_is_not_nothrow_constructible()
{
static_assert((!std::is_nothrow_constructible<T, A0, A1>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_nothrow_constructible_v<T, A0, A1>), "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_nothrow_assign()
{
static_assert( std::is_nothrow_copy_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_copy_assignable_v<T>, "");
#endif
}
template <class T>
void test_has_not_nothrow_assign()
{
static_assert(!std::is_nothrow_copy_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_nothrow_copy_assignable_v<T>, "");
#endif
}
class Empty

View File

@ -18,6 +18,10 @@ void test_is_nothrow_copy_constructible()
{
static_assert( std::is_nothrow_copy_constructible<T>::value, "");
static_assert( std::is_nothrow_copy_constructible<const T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_copy_constructible_v<T>, "");
static_assert( std::is_nothrow_copy_constructible_v<const T>, "");
#endif
}
template <class T>
@ -27,6 +31,12 @@ void test_has_not_nothrow_copy_constructor()
static_assert(!std::is_nothrow_copy_constructible<const T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_nothrow_copy_constructible_v<T>, "");
static_assert(!std::is_nothrow_copy_constructible_v<const T>, "");
static_assert(!std::is_nothrow_copy_constructible_v<volatile T>, "");
static_assert(!std::is_nothrow_copy_constructible_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -20,6 +20,12 @@ void test_is_nothrow_default_constructible()
static_assert( std::is_nothrow_default_constructible<const T>::value, "");
static_assert( std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert( std::is_nothrow_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_default_constructible_v<T>, "");
static_assert( std::is_nothrow_default_constructible_v<const T>, "");
static_assert( std::is_nothrow_default_constructible_v<volatile T>, "");
static_assert( std::is_nothrow_default_constructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -29,6 +35,12 @@ void test_has_not_nothrow_default_constructor()
static_assert(!std::is_nothrow_default_constructible<const T>::value, "");
static_assert(!std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_nothrow_default_constructible_v<T>, "");
static_assert(!std::is_nothrow_default_constructible_v<const T>, "");
static_assert(!std::is_nothrow_default_constructible_v<volatile T>, "");
static_assert(!std::is_nothrow_default_constructible_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -22,6 +22,12 @@ void test_is_nothrow_destructible()
static_assert( std::is_nothrow_destructible<const T>::value, "");
static_assert( std::is_nothrow_destructible<volatile T>::value, "");
static_assert( std::is_nothrow_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_destructible_v<T>, "");
static_assert( std::is_nothrow_destructible_v<const T>, "");
static_assert( std::is_nothrow_destructible_v<volatile T>, "");
static_assert( std::is_nothrow_destructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -31,6 +37,12 @@ void test_is_not_nothrow_destructible()
static_assert(!std::is_nothrow_destructible<const T>::value, "");
static_assert(!std::is_nothrow_destructible<volatile T>::value, "");
static_assert(!std::is_nothrow_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_nothrow_destructible_v<T>, "");
static_assert(!std::is_nothrow_destructible_v<const T>, "");
static_assert(!std::is_nothrow_destructible_v<volatile T>, "");
static_assert(!std::is_nothrow_destructible_v<const volatile T>, "");
#endif
}

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_nothrow_assign()
{
static_assert( std::is_nothrow_move_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_assignable_v<T>, "");
#endif
}
template <class T>
void test_has_not_nothrow_assign()
{
static_assert(!std::is_nothrow_move_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_assignable_v<T>, "");
#endif
}
class Empty

View File

@ -18,6 +18,10 @@ void test_is_nothrow_move_constructible()
{
static_assert( std::is_nothrow_move_constructible<T>::value, "");
static_assert( std::is_nothrow_move_constructible<const T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_nothrow_move_constructible_v<T>, "");
static_assert( std::is_nothrow_move_constructible_v<const T>, "");
#endif
}
template <class T>
@ -27,6 +31,12 @@ void test_has_not_nothrow_move_constructor()
static_assert(!std::is_nothrow_move_constructible<const T>::value, "");
static_assert(!std::is_nothrow_move_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_move_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_nothrow_move_constructible_v<T>, "");
static_assert(!std::is_nothrow_move_constructible_v<const T>, "");
static_assert(!std::is_nothrow_move_constructible_v<volatile T>, "");
static_assert(!std::is_nothrow_move_constructible_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T, class U>
void test_is_trivially_assignable()
{
static_assert(( std::is_trivially_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_trivially_assignable_v<T, U>), "");
#endif
}
template <class T, class U>
void test_is_not_trivially_assignable()
{
static_assert((!std::is_trivially_assignable<T, U>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_trivially_assignable_v<T, U>), "");
#endif
}
struct A

View File

@ -18,30 +18,45 @@ template <class T>
void test_is_trivially_constructible()
{
static_assert(( std::is_trivially_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_trivially_constructible_v<T>), "");
#endif
}
template <class T, class A0>
void test_is_trivially_constructible()
{
static_assert(( std::is_trivially_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert(( std::is_trivially_constructible_v<T, A0>), "");
#endif
}
template <class T>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_trivially_constructible_v<T>), "");
#endif
}
template <class T, class A0>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T, A0>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_trivially_constructible_v<T, A0>), "");
#endif
}
template <class T, class A0, class A1>
void test_is_not_trivially_constructible()
{
static_assert((!std::is_trivially_constructible<T, A0, A1>::value), "");
#if TEST_STD_VER > 14
static_assert((!std::is_trivially_constructible_v<T, A0, A1>), "");
#endif
}
struct A

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_trivially_copy_assignable()
{
static_assert( std::is_trivially_copy_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_copy_assignable_v<T>, "");
#endif
}
template <class T>
void test_has_not_trivially_copy_assignable()
{
static_assert(!std::is_trivially_copy_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_copy_assignable_v<T>, "");
#endif
}
class Empty

View File

@ -18,6 +18,10 @@ void test_is_trivially_copy_constructible()
{
static_assert( std::is_trivially_copy_constructible<T>::value, "");
static_assert( std::is_trivially_copy_constructible<const T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_copy_constructible_v<T>, "");
static_assert( std::is_trivially_copy_constructible_v<const T>, "");
#endif
}
template <class T>
@ -25,6 +29,10 @@ void test_has_not_trivial_copy_constructor()
{
static_assert(!std::is_trivially_copy_constructible<T>::value, "");
static_assert(!std::is_trivially_copy_constructible<const T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_copy_constructible_v<T>, "");
static_assert(!std::is_trivially_copy_constructible_v<const T>, "");
#endif
}
class Empty

View File

@ -20,6 +20,12 @@ void test_is_trivially_default_constructible()
static_assert( std::is_trivially_default_constructible<const T>::value, "");
static_assert( std::is_trivially_default_constructible<volatile T>::value, "");
static_assert( std::is_trivially_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_default_constructible_v<T>, "");
static_assert( std::is_trivially_default_constructible_v<const T>, "");
static_assert( std::is_trivially_default_constructible_v<volatile T>, "");
static_assert( std::is_trivially_default_constructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -29,6 +35,12 @@ void test_has_not_trivial_default_constructor()
static_assert(!std::is_trivially_default_constructible<const T>::value, "");
static_assert(!std::is_trivially_default_constructible<volatile T>::value, "");
static_assert(!std::is_trivially_default_constructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_default_constructible_v<T>, "");
static_assert(!std::is_trivially_default_constructible_v<const T>, "");
static_assert(!std::is_trivially_default_constructible_v<volatile T>, "");
static_assert(!std::is_trivially_default_constructible_v<const volatile T>, "");
#endif
}
class Empty

View File

@ -22,6 +22,12 @@ void test_is_trivially_destructible()
static_assert( std::is_trivially_destructible<const T>::value, "");
static_assert( std::is_trivially_destructible<volatile T>::value, "");
static_assert( std::is_trivially_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_destructible_v<T>, "");
static_assert( std::is_trivially_destructible_v<const T>, "");
static_assert( std::is_trivially_destructible_v<volatile T>, "");
static_assert( std::is_trivially_destructible_v<const volatile T>, "");
#endif
}
template <class T>
@ -31,6 +37,12 @@ void test_is_not_trivially_destructible()
static_assert(!std::is_trivially_destructible<const T>::value, "");
static_assert(!std::is_trivially_destructible<volatile T>::value, "");
static_assert(!std::is_trivially_destructible<const volatile T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_destructible_v<T>, "");
static_assert(!std::is_trivially_destructible_v<const T>, "");
static_assert(!std::is_trivially_destructible_v<volatile T>, "");
static_assert(!std::is_trivially_destructible_v<const volatile T>, "");
#endif
}
struct PublicDestructor { public: ~PublicDestructor() {}};

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_trivial_assign()
{
static_assert( std::is_trivially_move_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_move_assignable_v<T>, "");
#endif
}
template <class T>
void test_has_not_trivial_assign()
{
static_assert(!std::is_trivially_move_assignable<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_move_assignable_v<T>, "");
#endif
}
class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_trivially_move_constructible()
{
static_assert( std::is_trivially_move_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert( std::is_trivially_move_constructible_v<T>, "");
#endif
}
template <class T>
void test_has_not_trivial_move_constructor()
{
static_assert(!std::is_trivially_move_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_trivially_move_constructible_v<T>, "");
#endif
}
class Empty