From: Ville Voutilainen Date: Fri, 29 Jul 2016 19:01:39 +0000 (+0300) Subject: Implement C++17 variable templates for type traits. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=137422c80ccc32dd501f83d098a02458cd287c5d;p=gcc.git Implement C++17 variable templates for type traits. * include/std/chrono (treat_as_floating_point_v): New. * include/std/ratio (ratio_equal_v, ratio_not_equal_v) (ratio_less_v, ratio_less_equal_v, ratio_greater_v) (ratio_greater_equal_v): Likewise. * include/std/system_error (is_error_code_enum_v) (is_error_condition_enum_v): Likewise. * include/std/tuple (tuple_size_v): Likewise. * type_traits (conjunction_v, disjunction_v, negation_v) (is_void_v, is_null_pointer_v, is_integral_v, is_floating_point_v) (is_array_v, is_pointer_v, is_lvalue_reference_v) (is_rvalue_reference_v, is_member_object_pointer_v) (is_member_function_pointer_v, is_enum_v, is_union_v) (is_class_v, is_function_v, is_reference_v, is_arithmetic_v) (is_fundamental_v, is_object_v, is_scalar_v, is_compound_v) (is_member_pointer_v, is_const_v, is_volatile_v, is_trivial_v) (is_trivially_copyable_v, is_standard_layout_v) (is_pod_v, is_literal_type_v, is_empty_v, is_polymorphic_v) (is_abstract_v, is_final_v, is_signed_v, is_unsigned_v) (is_constructible_v, is_default_constructible_v) (is_copy_constructible_v, is_move_constructible_v) (is_assignable_v, is_copy_assignable_v, is_move_assignable_v) (is_destructible_v, is_trivially_constructible_v) (is_trivially_default_constructible_v) (is_trivially_copy_constructible_v, is_trivially_move_constructible_v) (is_trivially_assignable_v, is_trivially_copy_assignable_v) (is_trivially_move_assignable_v, is_trivially_destructible_v) (is_nothrow_constructible_v, is_nothrow_default_constructible_v) (is_nothrow_copy_constructible_v, is_nothrow_move_constructible_v) (is_nothrow_assignable_v, is_nothrow_copy_assignable_v) (is_nothrow_move_assignable_v, is_nothrow_destructible_v) (has_virtual_destructor_v, alignment_of_v, rank_v, extent_v) (is_same_v, is_base_of_v, is_convertible_v): Likewise. * testsuite/19_diagnostics/error_code/is_error_code_v.cc: Likewise. * testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc: Likewise. * testsuite/20_util/ratio/requirements/ratio_equal_v.cc: Likewise. * testsuite/20_util/tuple/tuple_size_v.cc: Likewise. * testsuite/20_util/variable_templates_for_traits.cc: Likewise. From-SVN: r238892 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 702c137cce4..40102865bce 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,45 @@ +2016-07-29 Ville Voutilainen + + Implement C++17 variable templates for type traits. + * include/std/chrono (treat_as_floating_point_v): New. + * include/std/ratio (ratio_equal_v, ratio_not_equal_v) + (ratio_less_v, ratio_less_equal_v, ratio_greater_v) + (ratio_greater_equal_v): Likewise. + * include/std/system_error (is_error_code_enum_v) + (is_error_condition_enum_v): Likewise. + * include/std/tuple (tuple_size_v): Likewise. + * type_traits (conjunction_v, disjunction_v, negation_v) + (is_void_v, is_null_pointer_v, is_integral_v, is_floating_point_v) + (is_array_v, is_pointer_v, is_lvalue_reference_v) + (is_rvalue_reference_v, is_member_object_pointer_v) + (is_member_function_pointer_v, is_enum_v, is_union_v) + (is_class_v, is_function_v, is_reference_v, is_arithmetic_v) + (is_fundamental_v, is_object_v, is_scalar_v, is_compound_v) + (is_member_pointer_v, is_const_v, is_volatile_v, is_trivial_v) + (is_trivially_copyable_v, is_standard_layout_v) + (is_pod_v, is_literal_type_v, is_empty_v, is_polymorphic_v) + (is_abstract_v, is_final_v, is_signed_v, is_unsigned_v) + (is_constructible_v, is_default_constructible_v) + (is_copy_constructible_v, is_move_constructible_v) + (is_assignable_v, is_copy_assignable_v, is_move_assignable_v) + (is_destructible_v, is_trivially_constructible_v) + (is_trivially_default_constructible_v) + (is_trivially_copy_constructible_v, is_trivially_move_constructible_v) + (is_trivially_assignable_v, is_trivially_copy_assignable_v) + (is_trivially_move_assignable_v, is_trivially_destructible_v) + (is_nothrow_constructible_v, is_nothrow_default_constructible_v) + (is_nothrow_copy_constructible_v, is_nothrow_move_constructible_v) + (is_nothrow_assignable_v, is_nothrow_copy_assignable_v) + (is_nothrow_move_assignable_v, is_nothrow_destructible_v) + (has_virtual_destructor_v, alignment_of_v, rank_v, extent_v) + (is_same_v, is_base_of_v, is_convertible_v): Likewise. + * testsuite/19_diagnostics/error_code/is_error_code_v.cc: Likewise. + * testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc: + Likewise. + * testsuite/20_util/ratio/requirements/ratio_equal_v.cc: Likewise. + * testsuite/20_util/tuple/tuple_size_v.cc: Likewise. + * testsuite/20_util/variable_templates_for_traits.cc: Likewise. + 2016-07-29 Andreas Schwab * config/abi/post/aarch64-linux-gnu/baseline_symbols.txt: Update. diff --git a/libstdc++-v3/include/std/chrono b/libstdc++-v3/include/std/chrono index 9104881eb93..fdb21b34d43 100644 --- a/libstdc++-v3/include/std/chrono +++ b/libstdc++-v3/include/std/chrono @@ -208,7 +208,11 @@ _GLIBCXX_END_NAMESPACE_VERSION struct treat_as_floating_point : is_floating_point<_Rep> { }; - +#if __cplusplus > 201402L + template + constexpr bool treat_as_floating_point_v = + treat_as_floating_point<_Rep>::value; +#endif // C++17 /// duration_values template struct duration_values diff --git a/libstdc++-v3/include/std/ratio b/libstdc++-v3/include/std/ratio index 9d7b61cd840..4a243a0cf73 100644 --- a/libstdc++-v3/include/std/ratio +++ b/libstdc++-v3/include/std/ratio @@ -401,6 +401,22 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION : integral_constant::value> { }; +#if __cplusplus > 201402L + template + constexpr bool ratio_equal_v = ratio_equal<_R1, _R2>::value; + template + constexpr bool ratio_not_equal_v = ratio_not_equal<_R1, _R2>::value; + template + constexpr bool ratio_less_v = ratio_less<_R1, _R2>::value; + template + constexpr bool ratio_less_equal_v = ratio_less_equal<_R1, _R2>::value; + template + constexpr bool ratio_greater_v = ratio_greater<_R1, _R2>::value; + template + constexpr bool ratio_greater_equal_v + = ratio_greater_equal<_R1, _R2>::value; +#endif // C++17 + template= 0), bool = (_R2::num >= 0), diff --git a/libstdc++-v3/include/std/system_error b/libstdc++-v3/include/std/system_error index 79320fac598..1ef64f46015 100644 --- a/libstdc++-v3/include/std/system_error +++ b/libstdc++-v3/include/std/system_error @@ -60,6 +60,13 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct is_error_condition_enum : public true_type { }; +#if __cplusplus > 201402L + template + constexpr bool is_error_code_enum_v = is_error_code_enum<_Tp>::value; + template + constexpr bool is_error_condition_enum_v = + is_error_condition_enum<_Tp>::value; +#endif // C++17 inline namespace _V2 { /// error_category diff --git a/libstdc++-v3/include/std/tuple b/libstdc++-v3/include/std/tuple index 180a34629f8..c1c924c1212 100644 --- a/libstdc++-v3/include/std/tuple +++ b/libstdc++-v3/include/std/tuple @@ -1265,6 +1265,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct tuple_size> : public integral_constant { }; +#if __cplusplus > 201402L + template + constexpr size_t tuple_size_v = tuple_size<_Tp>::value; +#endif + template constexpr _Head& __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept diff --git a/libstdc++-v3/include/std/type_traits b/libstdc++-v3/include/std/type_traits index e5c0d468f92..bfdc3ba90cf 100644 --- a/libstdc++-v3/include/std/type_traits +++ b/libstdc++-v3/include/std/type_traits @@ -172,6 +172,19 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION struct negation : __not_<_Pp> { }; + + template + constexpr bool conjunction_v + = conjunction<_Bn...>::value; + + template + constexpr bool disjunction_v + = disjunction<_Bn...>::value; + + template + constexpr bool negation_v + = negation<_Pp>::value; + #endif // For several sfinae-friendly trait implementations we transport both the @@ -2765,6 +2778,159 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; #endif // __cplusplus >= 201402L + +#if __cplusplus > 201402L +template + constexpr bool is_void_v = is_void<_Tp>::value; +template + constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value; +template + constexpr bool is_integral_v = is_integral<_Tp>::value; +template + constexpr bool is_floating_point_v = is_floating_point<_Tp>::value; +template + constexpr bool is_array_v = is_array<_Tp>::value; +template + constexpr bool is_pointer_v = is_pointer<_Tp>::value; +template + constexpr bool is_lvalue_reference_v = is_lvalue_reference<_Tp>::value; +template + constexpr bool is_rvalue_reference_v = is_rvalue_reference<_Tp>::value; +template + constexpr bool is_member_object_pointer_v = + is_member_object_pointer<_Tp>::value; +template + constexpr bool is_member_function_pointer_v = + is_member_function_pointer<_Tp>::value; +template + constexpr bool is_enum_v = is_enum<_Tp>::value; +template + constexpr bool is_union_v = is_union<_Tp>::value; +template + constexpr bool is_class_v = is_class<_Tp>::value; +template + constexpr bool is_function_v = is_function<_Tp>::value; +template + constexpr bool is_reference_v = is_reference<_Tp>::value; +template + constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value; +template + constexpr bool is_fundamental_v = is_fundamental<_Tp>::value; +template + constexpr bool is_object_v = is_object<_Tp>::value; +template + constexpr bool is_scalar_v = is_scalar<_Tp>::value; +template + constexpr bool is_compound_v = is_compound<_Tp>::value; +template + constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value; +template + constexpr bool is_const_v = is_const<_Tp>::value; +template + constexpr bool is_volatile_v = is_volatile<_Tp>::value; +template + constexpr bool is_trivial_v = is_trivial<_Tp>::value; +template + constexpr bool is_trivially_copyable_v = is_trivially_copyable<_Tp>::value; +template + constexpr bool is_standard_layout_v = is_standard_layout<_Tp>::value; +template + constexpr bool is_pod_v = is_pod<_Tp>::value; +template + constexpr bool is_literal_type_v = is_literal_type<_Tp>::value; +template + constexpr bool is_empty_v = is_empty<_Tp>::value; +template + constexpr bool is_polymorphic_v = is_polymorphic<_Tp>::value; +template + constexpr bool is_abstract_v = is_abstract<_Tp>::value; +template + constexpr bool is_final_v = is_final<_Tp>::value; +template + constexpr bool is_signed_v = is_signed<_Tp>::value; +template + constexpr bool is_unsigned_v = is_unsigned<_Tp>::value; +template + constexpr bool is_constructible_v = is_constructible<_Tp, _Args...>::value; +template + constexpr bool is_default_constructible_v = + is_default_constructible<_Tp>::value; +template + constexpr bool is_copy_constructible_v = is_copy_constructible<_Tp>::value; +template + constexpr bool is_move_constructible_v = is_move_constructible<_Tp>::value; +template + constexpr bool is_assignable_v = is_assignable<_Tp, _Up>::value; +template + constexpr bool is_copy_assignable_v = is_copy_assignable<_Tp>::value; +template + constexpr bool is_move_assignable_v = is_move_assignable<_Tp>::value; +template + constexpr bool is_destructible_v = is_destructible<_Tp>::value; +template + constexpr bool is_trivially_constructible_v = + is_trivially_constructible<_Tp, _Args...>::value; +template + constexpr bool is_trivially_default_constructible_v = + is_trivially_default_constructible<_Tp>::value; +template + constexpr bool is_trivially_copy_constructible_v = + is_trivially_copy_constructible<_Tp>::value; +template + constexpr bool is_trivially_move_constructible_v = + is_trivially_move_constructible<_Tp>::value; +template + constexpr bool is_trivially_assignable_v = + is_trivially_assignable<_Tp, _Up>::value; +template + constexpr bool is_trivially_copy_assignable_v = + is_trivially_copy_assignable<_Tp>::value; +template + constexpr bool is_trivially_move_assignable_v = + is_trivially_move_assignable<_Tp>::value; +template + constexpr bool is_trivially_destructible_v = + is_trivially_destructible<_Tp>::value; +template + constexpr bool is_nothrow_constructible_v = + is_nothrow_constructible<_Tp, _Args...>::value; +template + constexpr bool is_nothrow_default_constructible_v = + is_nothrow_default_constructible<_Tp>::value; +template + constexpr bool is_nothrow_copy_constructible_v = + is_nothrow_copy_constructible<_Tp>::value; +template + constexpr bool is_nothrow_move_constructible_v = + is_nothrow_move_constructible<_Tp>::value; +template + constexpr bool is_nothrow_assignable_v = + is_nothrow_assignable<_Tp, _Up>::value; +template + constexpr bool is_nothrow_copy_assignable_v = + is_nothrow_copy_assignable<_Tp>::value; +template + constexpr bool is_nothrow_move_assignable_v = + is_nothrow_move_assignable<_Tp>::value; +template + constexpr bool is_nothrow_destructible_v = + is_nothrow_destructible<_Tp>::value; +template + constexpr bool has_virtual_destructor_v = + has_virtual_destructor<_Tp>::value; +template + constexpr size_t alignment_of_v = alignment_of<_Tp>::value; +template + constexpr size_t rank_v = rank<_Tp>::value; +template + constexpr size_t extent_v = extent<_Tp, _Idx>::value; +template + constexpr bool is_same_v = is_same<_Tp, _Up>::value; +template + constexpr bool is_base_of_v = is_base_of<_Base, _Derived>::value; +template + constexpr bool is_convertible_v = is_convertible<_From, _To>::value; +#endif // C++17 #endif _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc b/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc new file mode 100644 index 00000000000..629cae1fcf8 --- /dev/null +++ b/libstdc++-v3/testsuite/19_diagnostics/error_code/is_error_code_v.cc @@ -0,0 +1,39 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2014-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include +#include +using namespace std; + +// These tests are rather simple, the front-end tests already test +// variable templates, and the library tests for the underlying +// traits are more elaborate. These are just simple sanity tests. + +static_assert(is_error_code_enum_v + && is_error_code_enum::value, ""); + +static_assert(!is_error_code_enum_v + && !is_error_code_enum::value, ""); + +static_assert(is_error_condition_enum_v + && is_error_condition_enum::value, ""); + +static_assert(!is_error_condition_enum_v + && !is_error_condition_enum::value, ""); diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc new file mode 100644 index 00000000000..0148239f5e0 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/duration/requirements/treat_as_floating_point_v.cc @@ -0,0 +1,33 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2014-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std::chrono; + +// These tests are rather simple, the front-end tests already test +// variable templates, and the library tests for the underlying +// traits are more elaborate. These are just simple sanity tests. + +static_assert(!treat_as_floating_point_v + && !treat_as_floating_point::value, ""); + +static_assert(treat_as_floating_point_v + && treat_as_floating_point::value, ""); diff --git a/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc b/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc new file mode 100644 index 00000000000..1158a67dd39 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/ratio/requirements/ratio_equal_v.cc @@ -0,0 +1,49 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2014-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std; + +// These tests are rather simple, the front-end tests already test +// variable templates, and the library tests for the underlying +// traits are more elaborate. These are just simple sanity tests. + +static_assert(ratio_equal_v, ratio<2, 6>> + && ratio_equal, ratio<2, 6>>::value, ""); + +static_assert(ratio_not_equal_v, ratio<2, 5>> + && ratio_not_equal, ratio<2, 5>>::value, ""); + +static_assert(ratio_less_v, ratio<1, 3>> + && ratio_less, ratio<1, 3>>::value, ""); + +static_assert(ratio_less_equal_v, ratio<1, 4>> + && ratio_less_equal_v, ratio<1, 3>> + && ratio_less_equal, ratio<1, 4>>::value + && ratio_less_equal, ratio<1, 3>>::value, ""); + +static_assert(ratio_greater_v, ratio<1, 4>> + && ratio_greater, ratio<1, 4>>::value, ""); + +static_assert(ratio_greater_equal_v, ratio<1, 4>> + && ratio_greater_equal_v, ratio<1, 4>> + && ratio_greater_equal, ratio<1, 4>>::value + && ratio_greater_equal, ratio<1, 4>>::value, ""); diff --git a/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc b/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc new file mode 100644 index 00000000000..29ce5c1701f --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/tuple/tuple_size_v.cc @@ -0,0 +1,33 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2014-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std; + +// These tests are rather simple, the front-end tests already test +// variable templates, and the library tests for the underlying +// traits are more elaborate. These are just simple sanity tests. + +static_assert(tuple_size_v> == 1 + && tuple_size>::value == 1, ""); + +static_assert(tuple_size_v> == 2 + && tuple_size>::value == 2, ""); diff --git a/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc b/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc new file mode 100644 index 00000000000..5a497f12445 --- /dev/null +++ b/libstdc++-v3/testsuite/20_util/variable_templates_for_traits.cc @@ -0,0 +1,344 @@ +// { dg-options "-std=gnu++17" } +// { dg-do compile } + +// Copyright (C) 2014-2016 Free Software Foundation, Inc. +// +// This file is part of the GNU ISO C++ Library. This library is free +// software; you can redistribute it and/or modify it under the +// terms of the GNU General Public License as published by the +// Free Software Foundation; either version 3, or (at your option) +// any later version. + +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a moved_to of the GNU General Public License along +// with this library; see the file COPYING3. If not see +// . + +#include + +using namespace std; + +// These tests are rather simple, the front-end tests already test +// variable templates, and the library tests for the underlying +// traits are more elaborate. These are just simple sanity tests. + +static_assert(is_void_v && is_void::value, ""); +static_assert(!is_void_v && !is_void::value, ""); + +static_assert(is_null_pointer_v + && is_null_pointer::value, ""); +static_assert(!is_null_pointer_v + && !is_null_pointer::value, ""); + +static_assert(is_integral_v && is_integral::value, ""); +static_assert(!is_integral_v && !is_integral::value, ""); + +static_assert(is_floating_point_v + && is_floating_point::value, ""); +static_assert(!is_floating_point_v + && !is_floating_point::value, ""); + +static_assert(is_array_v && is_array::value, ""); +static_assert(!is_array_v && !is_array::value, ""); + +static_assert(is_pointer_v && is_pointer::value, ""); +static_assert(!is_pointer_v && !is_pointer::value, ""); + +static_assert(is_lvalue_reference_v + && is_lvalue_reference::value, ""); +static_assert(!is_lvalue_reference_v + && !is_lvalue_reference::value, ""); + +static_assert(is_rvalue_reference_v + && is_rvalue_reference::value, ""); +static_assert(!is_rvalue_reference_v + && !is_rvalue_reference::value, ""); + +struct EmptyFinal final {}; + +static_assert(is_member_object_pointer_v + && is_member_object_pointer::value, ""); +static_assert(!is_member_object_pointer_v + && !is_member_object_pointer::value, ""); + +static_assert(is_member_function_pointer_v + && is_member_function_pointer::value, ""); +static_assert(!is_member_function_pointer_v + && !is_member_function_pointer::value, ""); + +enum Enum {}; + +static_assert(is_enum_v && is_enum::value, ""); +static_assert(!is_enum_v && !is_enum::value, ""); + +union Union; + +static_assert(is_union_v && is_union::value, ""); +static_assert(!is_union_v && !is_union::value, ""); + +static_assert(is_class_v && is_class::value, ""); +static_assert(!is_class_v && !is_class::value, ""); + +static_assert(is_function_v && is_function::value, ""); +static_assert(!is_function_v && !is_function::value, ""); + +static_assert(is_reference_v && is_reference::value, ""); +static_assert(!is_reference_v && !is_reference::value, ""); + +static_assert(is_arithmetic_v && is_arithmetic::value, ""); +static_assert(!is_arithmetic_v && !is_arithmetic::value, ""); + +static_assert(is_fundamental_v && is_fundamental::value, ""); +static_assert(!is_fundamental_v + && !is_fundamental::value, ""); + +static_assert(is_object_v && is_object::value, ""); +static_assert(!is_object_v && !is_object::value, ""); + +static_assert(is_scalar_v && is_scalar::value, ""); +static_assert(!is_scalar_v && !is_scalar::value, ""); + +static_assert(is_compound_v + && is_compound::value, ""); +static_assert(!is_compound_v && !is_compound::value, ""); + +static_assert(is_member_pointer_v + && is_member_pointer::value, ""); +static_assert(!is_member_pointer_v + && !is_member_pointer::value, ""); + +static_assert(is_const_v && is_const::value, ""); +static_assert(!is_const_v && !is_const::value, ""); + +static_assert(is_volatile_v + && is_volatile::value, ""); +static_assert(!is_volatile_v && !is_volatile::value, ""); + +struct NType +{ + NType(int); + ~NType(); + int i; +private: + NType(const NType&); + NType& operator=(const NType&); + int i2; +}; + +static_assert(is_trivial_v && is_trivial::value, ""); +static_assert(!is_trivial_v && !is_trivial::value, ""); + +static_assert(is_trivially_copyable_v + && is_trivially_copyable::value, ""); +static_assert(!is_trivially_copyable_v + && !is_trivially_copyable::value, ""); + +static_assert(is_standard_layout_v + && is_standard_layout::value, ""); +static_assert(!is_standard_layout_v + && !is_standard_layout::value, ""); + +static_assert(is_pod_v + && is_pod::value, ""); +static_assert(!is_pod_v + && !is_pod::value, ""); + +static_assert(is_literal_type_v + && is_literal_type::value, ""); +static_assert(!is_literal_type_v + && !is_literal_type::value, ""); + +static_assert(is_empty_v + && is_empty::value, ""); +static_assert(!is_empty_v + && !is_empty::value, ""); + +struct Abstract {protected: virtual ~Abstract() = 0;}; +struct Poly : Abstract {virtual ~Poly();}; + +static_assert(is_polymorphic_v + && is_polymorphic::value, ""); +static_assert(!is_polymorphic_v + && !is_polymorphic::value, ""); + + + +static_assert(is_abstract_v + && is_abstract::value, ""); +static_assert(!is_abstract_v + && !is_abstract::value, ""); + +static_assert(is_final_v + && is_final::value, ""); +static_assert(!is_final_v + && !is_final::value, ""); + +static_assert(is_signed_v && is_signed::value, ""); +static_assert(!is_signed_v + && !is_signed::value, ""); + +static_assert(is_constructible_v + && is_constructible::value, ""); +static_assert(!is_constructible_v + && !is_constructible::value, ""); + +static_assert(is_default_constructible_v + && is_default_constructible::value, ""); +static_assert(!is_default_constructible_v + && !is_default_constructible::value, ""); + +static_assert(is_copy_constructible_v + && is_copy_constructible::value, ""); +static_assert(!is_copy_constructible_v + && !is_copy_constructible::value, ""); + +static_assert(is_move_constructible_v + && is_copy_constructible::value, ""); +static_assert(!is_move_constructible_v + && !is_copy_constructible::value, ""); + +static_assert(is_assignable_v + && is_assignable::value, ""); +static_assert(!is_assignable_v + && !is_assignable::value, ""); + +static_assert(is_copy_assignable_v + && is_copy_assignable::value, ""); +static_assert(!is_copy_assignable_v + && !is_copy_assignable::value, ""); + +static_assert(is_move_assignable_v + && is_move_assignable::value, ""); +static_assert(!is_move_assignable_v + && !is_move_assignable::value, ""); + +static_assert(is_destructible_v + && is_destructible::value, ""); +static_assert(!is_destructible_v + && !is_destructible::value, ""); + +static_assert(is_trivially_constructible_v + && is_trivially_constructible::value, ""); +static_assert(!is_trivially_constructible_v + && !is_trivially_constructible::value, ""); + +static_assert(is_trivially_default_constructible_v + && is_trivially_default_constructible::value, ""); +static_assert(!is_trivially_default_constructible_v + && !is_trivially_default_constructible::value, ""); + +static_assert(is_trivially_copy_constructible_v + && is_trivially_copy_constructible::value, ""); +static_assert(!is_trivially_copy_constructible_v + && !is_trivially_copy_constructible::value, ""); + +static_assert(is_trivially_move_constructible_v + && is_trivially_move_constructible::value, ""); +static_assert(!is_trivially_move_constructible_v + && !is_trivially_move_constructible::value, ""); + +static_assert(is_trivially_assignable_v + && is_trivially_assignable::value, ""); +static_assert(!is_trivially_assignable_v + && !is_trivially_assignable::value, ""); + +static_assert(is_trivially_copy_assignable_v + && is_trivially_copy_assignable::value, ""); +static_assert(!is_trivially_copy_assignable_v + && !is_trivially_copy_assignable::value, ""); + +static_assert(is_trivially_move_assignable_v + && is_trivially_move_assignable::value, ""); +static_assert(!is_trivially_move_assignable_v + && !is_trivially_move_assignable::value, ""); + +static_assert(is_trivially_destructible_v + && is_trivially_destructible::value, ""); +static_assert(!is_trivially_destructible_v + && !is_trivially_destructible::value, ""); + +static_assert(is_nothrow_constructible_v + && is_nothrow_constructible::value, ""); +static_assert(!is_nothrow_constructible_v + && !is_nothrow_constructible::value, ""); + +static_assert(is_nothrow_default_constructible_v + && is_nothrow_default_constructible::value, ""); +static_assert(!is_nothrow_default_constructible_v + && !is_nothrow_default_constructible::value, ""); + +static_assert(is_nothrow_copy_constructible_v + && is_nothrow_copy_constructible::value, ""); +static_assert(!is_nothrow_copy_constructible_v + && !is_nothrow_copy_constructible::value, ""); + +static_assert(is_nothrow_move_constructible_v + && is_nothrow_move_constructible::value, ""); +static_assert(!is_nothrow_move_constructible_v + && !is_nothrow_move_constructible::value, ""); + +static_assert(is_nothrow_assignable_v + && is_nothrow_assignable::value, ""); +static_assert(!is_nothrow_assignable_v + && !is_nothrow_assignable::value, ""); + +static_assert(is_nothrow_copy_assignable_v + && is_nothrow_copy_assignable::value, ""); +static_assert(!is_nothrow_copy_assignable_v + && !is_nothrow_copy_assignable::value, ""); + +static_assert(is_nothrow_move_assignable_v + && is_nothrow_move_assignable::value, ""); +static_assert(!is_nothrow_move_assignable_v + && !is_nothrow_move_assignable::value, ""); + +static_assert(has_virtual_destructor_v + && has_virtual_destructor::value, ""); +static_assert(!has_virtual_destructor_v + && !has_virtual_destructor::value, ""); + +static_assert(alignment_of_v == alignof(int) + && alignment_of::value == alignof(int) , ""); + +static_assert(rank_v == rank::value, ""); + +static_assert(extent_v == 2 + && extent::value == 2, ""); + +static_assert(is_same_v && is_same::value, ""); +static_assert(!is_same_v && !is_same::value, ""); + +static_assert(is_base_of_v + && is_base_of::value, ""); +static_assert(!is_base_of_v + && !is_base_of::value, ""); + +static_assert(is_convertible_v + && is_convertible::value, ""); +static_assert(!is_convertible_v + && !is_convertible::value, ""); + +static_assert(negation_v, ""); +static_assert(!negation_v, ""); +static_assert(conjunction_v<>, ""); +static_assert(!disjunction_v<>, ""); +static_assert(conjunction_v, ""); +static_assert(!conjunction_v, ""); +static_assert(disjunction_v, ""); +static_assert(!disjunction_v, ""); +static_assert(conjunction_v, ""); +static_assert(!conjunction_v, ""); +static_assert(disjunction_v, ""); +static_assert(!disjunction_v, ""); +static_assert(conjunction_v, ""); +static_assert(!conjunction_v, ""); +static_assert(disjunction_v, ""); +static_assert(!disjunction_v, "");