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

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@252406 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Marshall Clow 2015-11-07 17:44:36 +00:00
parent a3b25f81d1
commit 6455d85714
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 #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 // alignment_of
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY alignment_of
@ -1905,12 +1910,22 @@ template <class _Tp, class _Arg>
struct is_assignable struct is_assignable
: public __is_assignable_imp<_Tp, _Arg> {}; : 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 // is_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_copy_assignable
: public is_assignable<typename add_lvalue_reference<_Tp>::type, : public is_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::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 // is_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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> {}; : public is_copy_assignable<_Tp> {};
#endif #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 // is_destructible
// if it's a reference, return true // if it's a reference, return true
@ -1979,6 +1999,11 @@ template <>
struct is_destructible<void> struct is_destructible<void>
: public _VSTD::false_type {}; : 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 // move
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES #ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
@ -3013,6 +3038,11 @@ struct __is_constructible2_imp<false, _Ap[], _A0, _A1>
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
#endif // __has_feature(is_constructible) #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 // is_default_constructible
template <class _Tp> template <class _Tp>
@ -3020,6 +3050,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_default_constructible
: public is_constructible<_Tp> : 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 // is_copy_constructible
template <class _Tp> template <class _Tp>
@ -3027,6 +3062,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_copy_constructible
: public is_constructible<_Tp, : public is_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::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_constructible_v
= is_copy_constructible<_Tp>::value;
#endif
// is_move_constructible // is_move_constructible
template <class _Tp> template <class _Tp>
@ -3038,6 +3078,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_move_constructible
#endif #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 // is_trivially_constructible
#ifndef _LIBCPP_HAS_NO_VARIADICS #ifndef _LIBCPP_HAS_NO_VARIADICS
@ -3165,18 +3210,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_trivially_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS #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 // is_trivially_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_trivially_default_constructible
: public is_trivially_constructible<_Tp> : 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 // is_trivially_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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> : 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 // is_trivially_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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 #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 // is_trivially_assignable
#if __has_feature(is_trivially_assignable) || _GNUC_VER >= 501 #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) #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 // is_trivially_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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, : public is_trivially_assignable<typename add_lvalue_reference<_Tp>::type,
typename add_lvalue_reference<typename add_const<_Tp>::type>::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 // is_trivially_move_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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 #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 // is_trivially_destructible
#if __has_feature(has_trivial_destructor) || (_GNUC_VER >= 403) #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 #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 // is_nothrow_constructible
#if 0 #if 0
@ -3423,18 +3508,33 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_constructible<_Tp, _Tp&,
#endif // _LIBCPP_HAS_NO_VARIADICS #endif // _LIBCPP_HAS_NO_VARIADICS
#endif // __has_feature(is_nothrow_constructible) #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 // is_nothrow_default_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_default_constructible
: public is_nothrow_constructible<_Tp> : 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 // is_nothrow_copy_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_copy_constructible
: public is_nothrow_constructible<_Tp, : public is_nothrow_constructible<_Tp,
typename add_lvalue_reference<typename add_const<_Tp>::type>::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_nothrow_copy_constructible_v
= is_nothrow_copy_constructible<_Tp>::value;
#endif
// is_nothrow_move_constructible // is_nothrow_move_constructible
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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 #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 // is_nothrow_assignable
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) #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) #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 // is_nothrow_copy_assignable
template <class _Tp> struct _LIBCPP_TYPE_VIS_ONLY 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 #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 // is_nothrow_destructible
#if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L) #if __has_feature(cxx_noexcept) || (_GNUC_VER >= 407 && __cplusplus >= 201103L)
@ -3591,6 +3706,11 @@ struct _LIBCPP_TYPE_VIS_ONLY is_nothrow_destructible<_Tp[]>
#endif #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 // is_pod
#if __has_feature(is_pod) || (_GNUC_VER >= 403) #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<const T>::value, "");
static_assert( std::has_virtual_destructor<volatile T>::value, ""); static_assert( std::has_virtual_destructor<volatile T>::value, "");
static_assert( std::has_virtual_destructor<const 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> 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<const T>::value, "");
static_assert(!std::has_virtual_destructor<volatile T>::value, ""); static_assert(!std::has_virtual_destructor<volatile T>::value, "");
static_assert(!std::has_virtual_destructor<const 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 class Empty

View File

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

View File

@ -38,30 +38,45 @@ template <class T>
void test_is_constructible() void test_is_constructible()
{ {
static_assert( (std::is_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_constructible() 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> template <class T, class A0, class A1>
void test_is_constructible() 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> template <class T>
void test_is_not_constructible() void test_is_not_constructible()
{ {
static_assert((!std::is_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_not_constructible() void test_is_not_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
} }
int main() int main()

View File

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

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_copy_constructible() void test_is_copy_constructible()
{ {
static_assert( std::is_copy_constructible<T>::value, ""); 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> template <class T>
void test_is_not_copy_constructible() void test_is_not_copy_constructible()
{ {
static_assert(!std::is_copy_constructible<T>::value, ""); static_assert(!std::is_copy_constructible<T>::value, "");
#if TEST_STD_VER > 14
static_assert(!std::is_copy_constructible_v<T>, "");
#endif
} }
class Empty 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<const T>::value, "");
static_assert( std::is_default_constructible<volatile T>::value, ""); static_assert( std::is_default_constructible<volatile T>::value, "");
static_assert( std::is_default_constructible<const 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> 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<const T>::value, "");
static_assert(!std::is_default_constructible<volatile T>::value, ""); static_assert(!std::is_default_constructible<volatile T>::value, "");
static_assert(!std::is_default_constructible<const 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 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<const T>::value, "");
static_assert( std::is_destructible<volatile T>::value, ""); static_assert( std::is_destructible<volatile T>::value, "");
static_assert( std::is_destructible<const 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> 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<const T>::value, "");
static_assert(!std::is_destructible<volatile T>::value, ""); static_assert(!std::is_destructible<volatile T>::value, "");
static_assert(!std::is_destructible<const 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 {}; class Empty {};

View File

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

View File

@ -16,13 +16,19 @@
template <class T> template <class T>
void test_is_move_assignable() 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> template <class T>
void test_is_not_move_assignable() 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 class Empty

View File

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

View File

@ -17,12 +17,18 @@ template <class T, class U>
void test_is_nothrow_assignable() void test_is_nothrow_assignable()
{ {
static_assert(( std::is_nothrow_assignable<T, U>::value), ""); 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> template <class T, class U>
void test_is_not_nothrow_assignable() void test_is_not_nothrow_assignable()
{ {
static_assert((!std::is_nothrow_assignable<T, U>::value), ""); 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 struct A

View File

@ -18,30 +18,45 @@ template <class T>
void test_is_nothrow_constructible() void test_is_nothrow_constructible()
{ {
static_assert(( std::is_nothrow_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_nothrow_constructible() void test_is_nothrow_constructible()
{ {
static_assert(( std::is_nothrow_constructible<T, A0>::value), ""); 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> template <class T>
void test_is_not_nothrow_constructible() void test_is_not_nothrow_constructible()
{ {
static_assert((!std::is_nothrow_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_not_nothrow_constructible() void test_is_not_nothrow_constructible()
{ {
static_assert((!std::is_nothrow_constructible<T, A0>::value), ""); 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> template <class T, class A0, class A1>
void test_is_not_nothrow_constructible() void test_is_not_nothrow_constructible()
{ {
static_assert((!std::is_nothrow_constructible<T, A0, A1>::value), ""); 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 class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_nothrow_assign() void test_has_nothrow_assign()
{ {
static_assert( std::is_nothrow_copy_assignable<T>::value, ""); 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> template <class T>
void test_has_not_nothrow_assign() void test_has_not_nothrow_assign()
{ {
static_assert(!std::is_nothrow_copy_assignable<T>::value, ""); 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 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<T>::value, "");
static_assert( std::is_nothrow_copy_constructible<const 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> 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<const T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<volatile T>::value, ""); static_assert(!std::is_nothrow_copy_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_copy_constructible<const 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 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<const T>::value, "");
static_assert( std::is_nothrow_default_constructible<volatile T>::value, ""); static_assert( std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert( std::is_nothrow_default_constructible<const 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> 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<const T>::value, "");
static_assert(!std::is_nothrow_default_constructible<volatile T>::value, ""); static_assert(!std::is_nothrow_default_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_default_constructible<const 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 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<const T>::value, "");
static_assert( std::is_nothrow_destructible<volatile T>::value, ""); static_assert( std::is_nothrow_destructible<volatile T>::value, "");
static_assert( std::is_nothrow_destructible<const 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> 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<const T>::value, "");
static_assert(!std::is_nothrow_destructible<volatile T>::value, ""); static_assert(!std::is_nothrow_destructible<volatile T>::value, "");
static_assert(!std::is_nothrow_destructible<const 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() void test_has_nothrow_assign()
{ {
static_assert( std::is_nothrow_move_assignable<T>::value, ""); 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> template <class T>
void test_has_not_nothrow_assign() void test_has_not_nothrow_assign()
{ {
static_assert(!std::is_nothrow_move_assignable<T>::value, ""); 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 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<T>::value, "");
static_assert( std::is_nothrow_move_constructible<const 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> 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<const T>::value, "");
static_assert(!std::is_nothrow_move_constructible<volatile T>::value, ""); static_assert(!std::is_nothrow_move_constructible<volatile T>::value, "");
static_assert(!std::is_nothrow_move_constructible<const 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 class Empty

View File

@ -17,12 +17,18 @@ template <class T, class U>
void test_is_trivially_assignable() void test_is_trivially_assignable()
{ {
static_assert(( std::is_trivially_assignable<T, U>::value), ""); 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> template <class T, class U>
void test_is_not_trivially_assignable() void test_is_not_trivially_assignable()
{ {
static_assert((!std::is_trivially_assignable<T, U>::value), ""); 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 struct A

View File

@ -18,30 +18,45 @@ template <class T>
void test_is_trivially_constructible() void test_is_trivially_constructible()
{ {
static_assert(( std::is_trivially_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_trivially_constructible() void test_is_trivially_constructible()
{ {
static_assert(( std::is_trivially_constructible<T, A0>::value), ""); 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> template <class T>
void test_is_not_trivially_constructible() void test_is_not_trivially_constructible()
{ {
static_assert((!std::is_trivially_constructible<T>::value), ""); 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> template <class T, class A0>
void test_is_not_trivially_constructible() void test_is_not_trivially_constructible()
{ {
static_assert((!std::is_trivially_constructible<T, A0>::value), ""); 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> template <class T, class A0, class A1>
void test_is_not_trivially_constructible() void test_is_not_trivially_constructible()
{ {
static_assert((!std::is_trivially_constructible<T, A0, A1>::value), ""); 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 struct A

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_trivially_copy_assignable() void test_has_trivially_copy_assignable()
{ {
static_assert( std::is_trivially_copy_assignable<T>::value, ""); 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> template <class T>
void test_has_not_trivially_copy_assignable() void test_has_not_trivially_copy_assignable()
{ {
static_assert(!std::is_trivially_copy_assignable<T>::value, ""); 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 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<T>::value, "");
static_assert( std::is_trivially_copy_constructible<const 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> 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<T>::value, "");
static_assert(!std::is_trivially_copy_constructible<const 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 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<const T>::value, "");
static_assert( std::is_trivially_default_constructible<volatile T>::value, ""); static_assert( std::is_trivially_default_constructible<volatile T>::value, "");
static_assert( std::is_trivially_default_constructible<const 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> 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<const T>::value, "");
static_assert(!std::is_trivially_default_constructible<volatile T>::value, ""); static_assert(!std::is_trivially_default_constructible<volatile T>::value, "");
static_assert(!std::is_trivially_default_constructible<const 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 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<const T>::value, "");
static_assert( std::is_trivially_destructible<volatile T>::value, ""); static_assert( std::is_trivially_destructible<volatile T>::value, "");
static_assert( std::is_trivially_destructible<const 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> 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<const T>::value, "");
static_assert(!std::is_trivially_destructible<volatile T>::value, ""); static_assert(!std::is_trivially_destructible<volatile T>::value, "");
static_assert(!std::is_trivially_destructible<const 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() {}}; struct PublicDestructor { public: ~PublicDestructor() {}};

View File

@ -17,12 +17,18 @@ template <class T>
void test_has_trivial_assign() void test_has_trivial_assign()
{ {
static_assert( std::is_trivially_move_assignable<T>::value, ""); 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> template <class T>
void test_has_not_trivial_assign() void test_has_not_trivial_assign()
{ {
static_assert(!std::is_trivially_move_assignable<T>::value, ""); 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 class Empty

View File

@ -17,12 +17,18 @@ template <class T>
void test_is_trivially_move_constructible() void test_is_trivially_move_constructible()
{ {
static_assert( std::is_trivially_move_constructible<T>::value, ""); 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> template <class T>
void test_has_not_trivial_move_constructor() void test_has_not_trivial_move_constructor()
{ {
static_assert(!std::is_trivially_move_constructible<T>::value, ""); 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 class Empty