29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
33#pragma GCC system_header
36#if __cplusplus < 201103L
42#define __glibcxx_want_bool_constant
43#define __glibcxx_want_bounded_array_traits
44#define __glibcxx_want_has_unique_object_representations
45#define __glibcxx_want_integral_constant_callable
46#define __glibcxx_want_is_aggregate
47#define __glibcxx_want_is_constant_evaluated
48#define __glibcxx_want_is_final
49#define __glibcxx_want_is_invocable
50#define __glibcxx_want_is_layout_compatible
51#define __glibcxx_want_is_nothrow_convertible
52#define __glibcxx_want_is_null_pointer
53#define __glibcxx_want_is_pointer_interconvertible
54#define __glibcxx_want_is_scoped_enum
55#define __glibcxx_want_is_swappable
56#define __glibcxx_want_is_virtual_base_of
57#define __glibcxx_want_logical_traits
58#define __glibcxx_want_reference_from_temporary
59#define __glibcxx_want_remove_cvref
60#define __glibcxx_want_result_of_sfinae
61#define __glibcxx_want_transformation_trait_aliases
62#define __glibcxx_want_type_identity
63#define __glibcxx_want_type_trait_variable_templates
64#define __glibcxx_want_unwrap_ref
65#define __glibcxx_want_void_t
70namespace std _GLIBCXX_VISIBILITY(default)
72_GLIBCXX_BEGIN_NAMESPACE_VERSION
74 template<
typename _Tp>
91 template<
typename _Tp, _Tp __v>
94 static constexpr _Tp value = __v;
95 using value_type = _Tp;
97 constexpr operator value_type()
const noexcept {
return value; }
99#ifdef __cpp_lib_integral_constant_callable
100 constexpr value_type operator()()
const noexcept {
return value; }
104#if ! __cpp_inline_variables
105 template<
typename _Tp, _Tp __v>
106 constexpr _Tp integral_constant<_Tp, __v>::value;
121#ifdef __cpp_lib_bool_constant
125 using bool_constant = __bool_constant<__v>;
132 template<
bool,
typename _Tp =
void>
137 template<
typename _Tp>
139 {
using type = _Tp; };
142 template<
bool _Cond,
typename _Tp =
void>
143 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
148 template<
typename _Tp,
typename>
153 struct __conditional<false>
155 template<
typename,
typename _Up>
160 template<
bool _Cond,
typename _If,
typename _Else>
161 using __conditional_t
165 template <
typename _Type>
166 struct __type_identity
167 {
using type = _Type; };
169 template<
typename _Tp>
170 using __type_identity_t =
typename __type_identity<_Tp>::type;
175 template<
typename _Tp,
typename...>
176 using __first_t = _Tp;
179 template<
typename... _Bn>
181 __enable_if_t<!bool(_Bn::value)>...>;
183 template<
typename... _Bn>
186 template<
typename... _Bn>
187 auto __and_fn(
int) -> __first_t<
true_type,
188 __enable_if_t<bool(_Bn::value)>...>;
190 template<
typename... _Bn>
197 template<
typename... _Bn>
199 : decltype(__detail::__or_fn<_Bn...>(0))
202 template<
typename... _Bn>
204 : decltype(__detail::__and_fn<_Bn...>(0))
207 template<
typename _Pp>
209 : __bool_constant<!bool(_Pp::value)>
213#ifdef __cpp_lib_logical_traits
216 template<
typename... _Bn>
217 inline constexpr bool __or_v = __or_<_Bn...>::value;
218 template<
typename... _Bn>
219 inline constexpr bool __and_v = __and_<_Bn...>::value;
223 template<
typename ,
typename _B1,
typename... _Bn>
224 struct __disjunction_impl
225 {
using type = _B1; };
227 template<
typename _B1,
typename _B2,
typename... _Bn>
228 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
229 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
231 template<
typename ,
typename _B1,
typename... _Bn>
232 struct __conjunction_impl
233 {
using type = _B1; };
235 template<
typename _B1,
typename _B2,
typename... _Bn>
236 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
237 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
241 template<
typename... _Bn>
243 : __detail::__conjunction_impl<void, _Bn...>::type
251 template<
typename... _Bn>
253 : __detail::__disjunction_impl<void, _Bn...>::type
261 template<
typename _Pp>
269 template<
typename... _Bn>
270 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
272 template<
typename... _Bn>
273 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
275 template<
typename _Pp>
276 inline constexpr bool negation_v = negation<_Pp>::value;
295 struct __is_array_unknown_bounds;
300 template <
typename _Tp,
size_t = sizeof(_Tp)>
301 constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
304 template <
typename _TypeIdentity,
305 typename _NestedType =
typename _TypeIdentity::type>
306 constexpr typename __or_<
310 __is_array_unknown_bounds<_NestedType>
311 >::type __is_complete_or_unbounded(_TypeIdentity)
315 template<
typename _Tp>
316 using __remove_cv_t =
typename remove_cv<_Tp>::type;
322 template<
typename _Tp>
331 struct is_void<const void>
332 :
public true_type { };
339 struct is_void<const volatile void>
344 struct __is_integral_helper
348 struct __is_integral_helper<bool>
352 struct __is_integral_helper<char>
356 struct __is_integral_helper<signed char>
360 struct __is_integral_helper<unsigned char>
367 struct __is_integral_helper<wchar_t>
370#ifdef _GLIBCXX_USE_CHAR8_T
372 struct __is_integral_helper<char8_t>
377 struct __is_integral_helper<char16_t>
381 struct __is_integral_helper<char32_t>
385 struct __is_integral_helper<short>
389 struct __is_integral_helper<unsigned short>
393 struct __is_integral_helper<int>
397 struct __is_integral_helper<unsigned int>
401 struct __is_integral_helper<long>
405 struct __is_integral_helper<unsigned long>
409 struct __is_integral_helper<long long>
413 struct __is_integral_helper<unsigned long long>
418#if defined(__GLIBCXX_TYPE_INT_N_0)
421 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
426 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
429#if defined(__GLIBCXX_TYPE_INT_N_1)
432 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
437 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
440#if defined(__GLIBCXX_TYPE_INT_N_2)
443 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
448 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
451#if defined(__GLIBCXX_TYPE_INT_N_3)
454 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
459 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
465 template<
typename _Tp>
467 :
public __is_integral_helper<__remove_cv_t<_Tp>>
::type
472 struct __is_floating_point_helper
476 struct __is_floating_point_helper<float>
477 :
public true_type { };
480 struct __is_floating_point_helper<double>
484 struct __is_floating_point_helper<long double>
487#ifdef __STDCPP_FLOAT16_T__
489 struct __is_floating_point_helper<_Float16>
493#ifdef __STDCPP_FLOAT32_T__
495 struct __is_floating_point_helper<_Float32>
499#ifdef __STDCPP_FLOAT64_T__
501 struct __is_floating_point_helper<_Float64>
505#ifdef __STDCPP_FLOAT128_T__
507 struct __is_floating_point_helper<_Float128>
511#ifdef __STDCPP_BFLOAT16_T__
513 struct __is_floating_point_helper<__gnu_cxx::__bfloat16_t>
517#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
519 struct __is_floating_point_helper<__float128>
525 template<
typename _Tp>
527 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>
::type
531#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
532 template<
typename _Tp>
534 :
public __bool_constant<__is_array(_Tp)>
541 template<
typename _Tp, std::
size_t _Size>
542 struct is_array<_Tp[_Size]>
543 :
public true_type { };
545 template<
typename _Tp>
551#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
552 template<
typename _Tp>
554 :
public __bool_constant<__is_pointer(_Tp)>
557 template<
typename _Tp>
561 template<
typename _Tp>
562 struct is_pointer<_Tp*>
563 :
public true_type { };
565 template<
typename _Tp>
569 template<
typename _Tp>
573 template<
typename _Tp>
583 template<
typename _Tp>
592 template<
typename _Tp>
597#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
598 template<
typename _Tp>
600 :
public __bool_constant<__is_member_object_pointer(_Tp)>
604 struct __is_member_object_pointer_helper
607 template<
typename _Tp,
typename _Cp>
608 struct __is_member_object_pointer_helper<_Tp _Cp::*>
609 :
public __not_<is_function<_Tp>>::type { };
612 template<
typename _Tp>
614 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
618#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
620 template<
typename _Tp>
622 :
public __bool_constant<__is_member_function_pointer(_Tp)>
626 struct __is_member_function_pointer_helper
629 template<
typename _Tp,
typename _Cp>
630 struct __is_member_function_pointer_helper<_Tp _Cp::*>
631 :
public is_function<_Tp>::type { };
634 template<
typename _Tp>
636 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
641 template<
typename _Tp>
643 :
public __bool_constant<__is_enum(_Tp)>
647 template<
typename _Tp>
649 :
public __bool_constant<__is_union(_Tp)>
653 template<
typename _Tp>
655 :
public __bool_constant<__is_class(_Tp)>
659#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
660 template<
typename _Tp>
662 :
public __bool_constant<__is_function(_Tp)>
665 template<
typename _Tp>
667 :
public __bool_constant<!is_const<const _Tp>::value> { };
669 template<
typename _Tp>
670 struct is_function<_Tp&>
671 :
public false_type { };
673 template<
typename _Tp>
678#ifdef __cpp_lib_is_null_pointer
680 template<typename _Tp>
681 struct is_null_pointer
685 struct is_null_pointer<std::nullptr_t>
689 struct is_null_pointer<const std::nullptr_t>
693 struct is_null_pointer<volatile std::nullptr_t>
697 struct is_null_pointer<const volatile std::nullptr_t>
702 template<
typename _Tp>
703 struct __is_nullptr_t
704 :
public is_null_pointer<_Tp>
705 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
711#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
712 template<
typename _Tp>
714 :
public __bool_constant<__is_reference(_Tp)>
717 template<
typename _Tp>
722 template<
typename _Tp>
723 struct is_reference<_Tp&>
727 template<
typename _Tp>
734 template<
typename _Tp>
736 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>
::type
740 template<
typename _Tp>
742 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
743 is_null_pointer<_Tp>>
::type
747#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
748 template<
typename _Tp>
750 :
public __bool_constant<__is_object(_Tp)>
753 template<
typename _Tp>
755 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
761 struct is_member_pointer;
764 template<
typename _Tp>
766 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
767 is_member_pointer<_Tp>, is_null_pointer<_Tp>>
::type
771 template<
typename _Tp>
773 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
776#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
777 template<
typename _Tp>
779 :
public __bool_constant<__is_member_pointer(_Tp)>
783 template<
typename _Tp>
784 struct __is_member_pointer_helper
787 template<
typename _Tp,
typename _Cp>
788 struct __is_member_pointer_helper<_Tp _Cp::*>
789 :
public true_type { };
792 template<
typename _Tp>
794 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
798 template<
typename,
typename>
802 template<
typename _Tp,
typename... _Types>
803 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
807 template<
typename _Tp>
808 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
809 signed char,
signed short,
signed int,
signed long,
811#if defined(__GLIBCXX_TYPE_INT_N_0)
812 ,
signed __GLIBCXX_TYPE_INT_N_0
814#if defined(__GLIBCXX_TYPE_INT_N_1)
815 ,
signed __GLIBCXX_TYPE_INT_N_1
817#if defined(__GLIBCXX_TYPE_INT_N_2)
818 ,
signed __GLIBCXX_TYPE_INT_N_2
820#if defined(__GLIBCXX_TYPE_INT_N_3)
821 ,
signed __GLIBCXX_TYPE_INT_N_3
827 template<
typename _Tp>
828 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
829 unsigned char,
unsigned short,
unsigned int,
unsigned long,
831#if defined(__GLIBCXX_TYPE_INT_N_0)
832 ,
unsigned __GLIBCXX_TYPE_INT_N_0
834#if defined(__GLIBCXX_TYPE_INT_N_1)
835 ,
unsigned __GLIBCXX_TYPE_INT_N_1
837#if defined(__GLIBCXX_TYPE_INT_N_2)
838 ,
unsigned __GLIBCXX_TYPE_INT_N_2
840#if defined(__GLIBCXX_TYPE_INT_N_3)
841 ,
unsigned __GLIBCXX_TYPE_INT_N_3
846 template<
typename _Tp>
847 using __is_standard_integer
848 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
851 template<
typename...>
using __void_t = void;
857#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
858 template<
typename _Tp>
860 :
public __bool_constant<__is_const(_Tp)>
867 template<
typename _Tp>
868 struct is_const<_Tp const>
869 :
public true_type { };
873#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
874 template<
typename _Tp>
876 :
public __bool_constant<__is_volatile(_Tp)>
883 template<
typename _Tp>
884 struct is_volatile<_Tp volatile>
885 :
public true_type { };
895 template<
typename _Tp>
897 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible && is_trivially_copyable")
899 : public __bool_constant<__is_trivial(_Tp)>
901 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
902 "template argument must be a complete class or an unbounded array");
906 template<
typename _Tp>
908 :
public __bool_constant<__is_trivially_copyable(_Tp)>
910 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
911 "template argument must be a complete class or an unbounded array");
915 template<
typename _Tp>
917 :
public __bool_constant<__is_standard_layout(_Tp)>
919 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
920 "template argument must be a complete class or an unbounded array");
928 template<
typename _Tp>
930 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
932 : public __bool_constant<__is_pod(_Tp)>
934 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
935 "template argument must be a complete class or an unbounded array");
942 template<
typename _Tp>
944 _GLIBCXX17_DEPRECATED
946 :
public __bool_constant<__is_literal_type(_Tp)>
948 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
949 "template argument must be a complete class or an unbounded array");
953 template<
typename _Tp>
955 :
public __bool_constant<__is_empty(_Tp)>
959 template<
typename _Tp>
961 :
public __bool_constant<__is_polymorphic(_Tp)>
964#ifdef __cpp_lib_is_final
967 template<typename _Tp>
969 :
public __bool_constant<__is_final(_Tp)>
974 template<
typename _Tp>
976 :
public __bool_constant<__is_abstract(_Tp)>
980 template<
typename _Tp,
982 struct __is_signed_helper
985 template<
typename _Tp>
986 struct __is_signed_helper<_Tp, true>
987 :
public __bool_constant<_Tp(-1) < _Tp(0)>
992 template<typename _Tp>
994 : public __is_signed_helper<_Tp>::type
998 template<typename _Tp>
1000 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
1004 template<typename _Tp, typename _Up = _Tp&&>
1008 template<typename _Tp>
1013 template<typename _Tp>
1014 auto declval() noexcept -> decltype(__declval<_Tp>(0));
1020 template<typename _Tp>
1021 struct __is_array_known_bounds
1025 template<
typename _Tp,
size_t _Size>
1026 struct __is_array_known_bounds<_Tp[_Size]>
1030 template<
typename _Tp>
1031 struct __is_array_unknown_bounds
1035 template<
typename _Tp>
1036 struct __is_array_unknown_bounds<_Tp[]>
1047 struct __do_is_destructible_impl
1049 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1050 static true_type __test(
int);
1056 template<
typename _Tp>
1057 struct __is_destructible_impl
1058 :
public __do_is_destructible_impl
1060 using type =
decltype(__test<_Tp>(0));
1063 template<
typename _Tp,
1064 bool = __or_<is_void<_Tp>,
1065 __is_array_unknown_bounds<_Tp>,
1068 struct __is_destructible_safe;
1070 template<
typename _Tp>
1071 struct __is_destructible_safe<_Tp, false, false>
1072 :
public __is_destructible_impl<typename
1073 remove_all_extents<_Tp>::type>::type
1076 template<
typename _Tp>
1077 struct __is_destructible_safe<_Tp, true, false>
1080 template<
typename _Tp>
1081 struct __is_destructible_safe<_Tp, false, true>
1086 template<
typename _Tp>
1088 :
public __is_destructible_safe<_Tp>
::type
1090 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1091 "template argument must be a complete class or an unbounded array");
1100 struct __do_is_nt_destructible_impl
1102 template<
typename _Tp>
1103 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1110 template<
typename _Tp>
1111 struct __is_nt_destructible_impl
1112 :
public __do_is_nt_destructible_impl
1114 using type =
decltype(__test<_Tp>(0));
1117 template<
typename _Tp,
1118 bool = __or_<is_void<_Tp>,
1119 __is_array_unknown_bounds<_Tp>,
1122 struct __is_nt_destructible_safe;
1124 template<
typename _Tp>
1125 struct __is_nt_destructible_safe<_Tp, false, false>
1126 :
public __is_nt_destructible_impl<typename
1127 remove_all_extents<_Tp>::type>::type
1130 template<
typename _Tp>
1131 struct __is_nt_destructible_safe<_Tp, true, false>
1134 template<
typename _Tp>
1135 struct __is_nt_destructible_safe<_Tp, false, true>
1140 template<
typename _Tp>
1142 :
public __is_nt_destructible_safe<_Tp>
::type
1144 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1145 "template argument must be a complete class or an unbounded array");
1149 template<
typename _Tp,
typename... _Args>
1150 using __is_constructible_impl
1151 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1155 template<
typename _Tp,
typename... _Args>
1157 :
public __is_constructible_impl<_Tp, _Args...>
1159 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1160 "template argument must be a complete class or an unbounded array");
1164 template<
typename _Tp>
1166 :
public __is_constructible_impl<_Tp>
1168 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1169 "template argument must be a complete class or an unbounded array");
1173#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_lvalue_reference)
1174 template<
typename _Tp>
1175 using __add_lval_ref_t = __add_lvalue_reference(_Tp);
1177 template<
typename _Tp,
typename =
void>
1178 struct __add_lvalue_reference_helper
1179 {
using type = _Tp; };
1181 template<
typename _Tp>
1182 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1183 {
using type = _Tp&; };
1185 template<
typename _Tp>
1186 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1191 template<
typename _Tp>
1193 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1195 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1196 "template argument must be a complete class or an unbounded array");
1200#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_rvalue_reference)
1201 template<
typename _Tp>
1202 using __add_rval_ref_t = __add_rvalue_reference(_Tp);
1204 template<
typename _Tp,
typename =
void>
1205 struct __add_rvalue_reference_helper
1206 {
using type = _Tp; };
1208 template<
typename _Tp>
1209 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1210 {
using type = _Tp&&; };
1212 template<
typename _Tp>
1213 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1218 template<
typename _Tp>
1220 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1222 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1223 "template argument must be a complete class or an unbounded array");
1227 template<
typename _Tp,
typename... _Args>
1228 using __is_nothrow_constructible_impl
1229 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1233 template<
typename _Tp,
typename... _Args>
1235 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1237 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1238 "template argument must be a complete class or an unbounded array");
1242 template<
typename _Tp>
1244 :
public __is_nothrow_constructible_impl<_Tp>
1246 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1247 "template argument must be a complete class or an unbounded array");
1251 template<
typename _Tp>
1253 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1255 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1256 "template argument must be a complete class or an unbounded array");
1260 template<
typename _Tp>
1262 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1264 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1265 "template argument must be a complete class or an unbounded array");
1269 template<
typename _Tp,
typename _Up>
1270 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1274 template<
typename _Tp,
typename _Up>
1276 :
public __is_assignable_impl<_Tp, _Up>
1278 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1279 "template argument must be a complete class or an unbounded array");
1283 template<
typename _Tp>
1285 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1286 __add_lval_ref_t<const _Tp>>
1288 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1289 "template argument must be a complete class or an unbounded array");
1293 template<
typename _Tp>
1295 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1297 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1298 "template argument must be a complete class or an unbounded array");
1302 template<
typename _Tp,
typename _Up>
1303 using __is_nothrow_assignable_impl
1304 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1308 template<
typename _Tp,
typename _Up>
1310 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1312 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1313 "template argument must be a complete class or an unbounded array");
1317 template<
typename _Tp>
1319 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1320 __add_lval_ref_t<const _Tp>>
1322 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1323 "template argument must be a complete class or an unbounded array");
1327 template<
typename _Tp>
1329 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1330 __add_rval_ref_t<_Tp>>
1332 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1333 "template argument must be a complete class or an unbounded array");
1337 template<
typename _Tp,
typename... _Args>
1338 using __is_trivially_constructible_impl
1339 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1343 template<
typename _Tp,
typename... _Args>
1345 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1347 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1348 "template argument must be a complete class or an unbounded array");
1352 template<
typename _Tp>
1354 :
public __is_trivially_constructible_impl<_Tp>
1356 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1357 "template argument must be a complete class or an unbounded array");
1360#if __cpp_variable_templates && __cpp_concepts
1361 template<
typename _Tp>
1362 constexpr bool __is_implicitly_default_constructible_v
1363 =
requires (void(&__f)(_Tp)) { __f({}); };
1365 template<
typename _Tp>
1366 struct __is_implicitly_default_constructible
1367 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1370 struct __do_is_implicitly_default_constructible_impl
1372 template <
typename _Tp>
1373 static void __helper(
const _Tp&);
1375 template <
typename _Tp>
1377 decltype(__helper<const _Tp&>({}))* = 0);
1382 template<
typename _Tp>
1383 struct __is_implicitly_default_constructible_impl
1384 :
public __do_is_implicitly_default_constructible_impl
1389 template<
typename _Tp>
1390 struct __is_implicitly_default_constructible_safe
1391 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1394 template <
typename _Tp>
1395 struct __is_implicitly_default_constructible
1396 :
public __and_<__is_constructible_impl<_Tp>,
1397 __is_implicitly_default_constructible_safe<_Tp>>::type
1402 template<
typename _Tp>
1404 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1406 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1407 "template argument must be a complete class or an unbounded array");
1411 template<
typename _Tp>
1413 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1415 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1416 "template argument must be a complete class or an unbounded array");
1420 template<
typename _Tp,
typename _Up>
1421 using __is_trivially_assignable_impl
1422 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1426 template<
typename _Tp,
typename _Up>
1428 :
public __is_trivially_assignable_impl<_Tp, _Up>
1430 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1431 "template argument must be a complete class or an unbounded array");
1435 template<
typename _Tp>
1437 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1438 __add_lval_ref_t<const _Tp>>
1440 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1441 "template argument must be a complete class or an unbounded array");
1445 template<
typename _Tp>
1447 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1448 __add_rval_ref_t<_Tp>>
1450 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1451 "template argument must be a complete class or an unbounded array");
1455 template<
typename _Tp>
1457 :
public __and_<__is_destructible_safe<_Tp>,
1458 __bool_constant<__has_trivial_destructor(_Tp)>>
::type
1460 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1461 "template argument must be a complete class or an unbounded array");
1466 template<
typename _Tp>
1468 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1470 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1471 "template argument must be a complete class or an unbounded array");
1478 template<
typename _Tp>
1482 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1483 "template argument must be a complete class or an unbounded array");
1487#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
1488 && (!defined(__clang__) || __clang_major__ >= 20)
1489 template<
typename _Tp>
1497 template<
typename _Tp, std::
size_t _Size>
1498 struct rank<_Tp[_Size]>
1499 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1501 template<
typename _Tp>
1507 template<
typename,
unsigned _U
int = 0>
1511 template<
typename _Tp,
size_t _Size>
1512 struct extent<_Tp[_Size], 0>
1515 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1516 struct extent<_Tp[_Size], _Uint>
1517 :
public extent<_Tp, _Uint - 1>::type { };
1519 template<
typename _Tp>
1523 template<
typename _Tp,
unsigned _U
int>
1524 struct extent<_Tp[], _Uint>
1525 :
public extent<_Tp, _Uint - 1>::type { };
1531#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1532 template<
typename _Tp,
typename _Up>
1534 :
public __bool_constant<__is_same(_Tp, _Up)>
1537 template<
typename _Tp,
typename _Up>
1542 template<
typename _Tp>
1543 struct is_same<_Tp, _Tp>
1549 template<
typename _Base,
typename _Derived>
1551 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1554#ifdef __cpp_lib_is_virtual_base_of
1557 template<typename _Base, typename _Derived>
1558 struct is_virtual_base_of
1559 :
public bool_constant<__builtin_is_virtual_base_of(_Base, _Derived)>
1563#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1564 template<
typename _From,
typename _To>
1565 struct is_convertible
1566 :
public __bool_constant<__is_convertible(_From, _To)>
1569 template<
typename _From,
typename _To,
1572 struct __is_convertible_helper
1574 using type =
typename is_void<_To>::type;
1577#pragma GCC diagnostic push
1578#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1579 template<
typename _From,
typename _To>
1580 class __is_convertible_helper<_From, _To, false>
1582 template<
typename _To1>
1583 static void __test_aux(_To1)
noexcept;
1585 template<
typename _From1,
typename _To1,
1590 template<
typename,
typename>
1595 using type =
decltype(__test<_From, _To>(0));
1597#pragma GCC diagnostic pop
1600 template<
typename _From,
typename _To>
1601 struct is_convertible
1602 :
public __is_convertible_helper<_From, _To>::type
1607 template<
typename _ToElementType,
typename _FromElementType>
1608 using __is_array_convertible
1609 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1611#ifdef __cpp_lib_is_nothrow_convertible
1613#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1615 template<
typename _From,
typename _To>
1616 inline constexpr bool is_nothrow_convertible_v
1617 = __is_nothrow_convertible(_From, _To);
1620 template<
typename _From,
typename _To>
1621 struct is_nothrow_convertible
1622 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1625 template<
typename _From,
typename _To,
1628 struct __is_nt_convertible_helper
1632#pragma GCC diagnostic push
1633#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1634 template<
typename _From,
typename _To>
1635 class __is_nt_convertible_helper<_From, _To, false>
1637 template<
typename _To1>
1638 static void __test_aux(_To1)
noexcept;
1640 template<
typename _From1,
typename _To1>
1645 template<
typename,
typename>
1650 using type =
decltype(__test<_From, _To>(0));
1652#pragma GCC diagnostic pop
1655 template<
typename _From,
typename _To>
1656 struct is_nothrow_convertible
1657 :
public __is_nt_convertible_helper<_From, _To>::type
1661 template<
typename _From,
typename _To>
1662 inline constexpr bool is_nothrow_convertible_v
1663 = is_nothrow_convertible<_From, _To>::value;
1667#pragma GCC diagnostic push
1668#pragma GCC diagnostic ignored "-Wc++14-extensions"
1669 template<
typename _Tp,
typename... _Args>
1670 struct __is_nothrow_new_constructible_impl
1672 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1676 template<
typename _Tp,
typename... _Args>
1677 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1679 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1680#pragma GCC diagnostic pop
1685 template<
typename _Tp>
1687 {
using type = _Tp; };
1689 template<
typename _Tp>
1691 {
using type = _Tp; };
1694 template<
typename _Tp>
1696 {
using type = _Tp; };
1698 template<
typename _Tp>
1700 {
using type = _Tp; };
1703#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1704 template<
typename _Tp>
1706 {
using type = __remove_cv(_Tp); };
1708 template<
typename _Tp>
1710 {
using type = _Tp; };
1712 template<
typename _Tp>
1713 struct remove_cv<const _Tp>
1714 {
using type = _Tp; };
1716 template<
typename _Tp>
1718 {
using type = _Tp; };
1720 template<
typename _Tp>
1722 {
using type = _Tp; };
1726 template<
typename _Tp>
1728 {
using type = _Tp
const; };
1731 template<
typename _Tp>
1733 {
using type = _Tp
volatile; };
1736 template<
typename _Tp>
1738 {
using type = _Tp
const volatile; };
1740#ifdef __cpp_lib_transformation_trait_aliases
1742 template<typename _Tp>
1743 using remove_const_t =
typename remove_const<_Tp>::type;
1746 template<
typename _Tp>
1747 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1750 template<
typename _Tp>
1751 using remove_cv_t =
typename remove_cv<_Tp>::type;
1754 template<
typename _Tp>
1755 using add_const_t =
typename add_const<_Tp>::type;
1758 template<
typename _Tp>
1759 using add_volatile_t =
typename add_volatile<_Tp>::type;
1762 template<
typename _Tp>
1763 using add_cv_t =
typename add_cv<_Tp>::type;
1769#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1770 template<
typename _Tp>
1772 {
using type = __remove_reference(_Tp); };
1774 template<
typename _Tp>
1776 {
using type = _Tp; };
1778 template<
typename _Tp>
1779 struct remove_reference<_Tp&>
1780 {
using type = _Tp; };
1782 template<
typename _Tp>
1784 {
using type = _Tp; };
1788 template<
typename _Tp>
1790 {
using type = __add_lval_ref_t<_Tp>; };
1793 template<
typename _Tp>
1795 {
using type = __add_rval_ref_t<_Tp>; };
1797#if __cplusplus > 201103L
1799 template<
typename _Tp>
1803 template<
typename _Tp>
1807 template<
typename _Tp>
1816 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1817 struct __cv_selector;
1819 template<
typename _Unqualified>
1820 struct __cv_selector<_Unqualified, false, false>
1821 {
using __type = _Unqualified; };
1823 template<
typename _Unqualified>
1824 struct __cv_selector<_Unqualified, false, true>
1825 {
using __type =
volatile _Unqualified; };
1827 template<
typename _Unqualified>
1828 struct __cv_selector<_Unqualified, true, false>
1829 {
using __type =
const _Unqualified; };
1831 template<
typename _Unqualified>
1832 struct __cv_selector<_Unqualified, true, true>
1833 {
using __type =
const volatile _Unqualified; };
1835 template<
typename _Qualified,
typename _Unqualified,
1838 class __match_cv_qualifiers
1840 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1843 using __type =
typename __match::__type;
1847 template<
typename _Tp>
1848 struct __make_unsigned
1849 {
using __type = _Tp; };
1852 struct __make_unsigned<char>
1853 {
using __type =
unsigned char; };
1856 struct __make_unsigned<signed char>
1857 {
using __type =
unsigned char; };
1860 struct __make_unsigned<short>
1861 {
using __type =
unsigned short; };
1864 struct __make_unsigned<int>
1865 {
using __type =
unsigned int; };
1868 struct __make_unsigned<long>
1869 {
using __type =
unsigned long; };
1872 struct __make_unsigned<long long>
1873 {
using __type =
unsigned long long; };
1875#if defined(__GLIBCXX_TYPE_INT_N_0)
1878 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1879 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1881#if defined(__GLIBCXX_TYPE_INT_N_1)
1884 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1885 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
1887#if defined(__GLIBCXX_TYPE_INT_N_2)
1890 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1891 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
1893#if defined(__GLIBCXX_TYPE_INT_N_3)
1896 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1897 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
1901 template<
typename _Tp,
1903 bool _IsEnum = __is_enum(_Tp)>
1904 class __make_unsigned_selector;
1906 template<
typename _Tp>
1907 class __make_unsigned_selector<_Tp, true, false>
1909 using __unsigned_type
1910 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1914 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1917 class __make_unsigned_selector_base
1920 template<
typename...>
struct _List { };
1922 template<
typename _Tp,
typename... _Up>
1923 struct _List<_Tp, _Up...> : _List<_Up...>
1924 {
static constexpr size_t __size =
sizeof(_Tp); };
1926 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1929 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1930 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1931 {
using __type = _Uint; };
1933 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1934 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1935 : __select<_Sz, _List<_UInts...>>
1940 template<
typename _Tp>
1941 class __make_unsigned_selector<_Tp, false, true>
1942 : __make_unsigned_selector_base
1945 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1946 unsigned long,
unsigned long long>;
1948 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1952 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1960 struct __make_unsigned<wchar_t>
1963 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1966#ifdef _GLIBCXX_USE_CHAR8_T
1968 struct __make_unsigned<char8_t>
1971 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1976 struct __make_unsigned<char16_t>
1979 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1983 struct __make_unsigned<char32_t>
1986 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1994 template<
typename _Tp>
1996 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
2007 template<
typename _Tp>
2008 struct __make_signed
2009 {
using __type = _Tp; };
2012 struct __make_signed<char>
2013 {
using __type =
signed char; };
2016 struct __make_signed<unsigned char>
2017 {
using __type =
signed char; };
2020 struct __make_signed<unsigned short>
2021 {
using __type =
signed short; };
2024 struct __make_signed<unsigned int>
2025 {
using __type =
signed int; };
2028 struct __make_signed<unsigned long>
2029 {
using __type =
signed long; };
2032 struct __make_signed<unsigned long long>
2033 {
using __type =
signed long long; };
2035#if defined(__GLIBCXX_TYPE_INT_N_0)
2038 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
2039 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
2041#if defined(__GLIBCXX_TYPE_INT_N_1)
2044 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
2045 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
2047#if defined(__GLIBCXX_TYPE_INT_N_2)
2050 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
2051 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
2053#if defined(__GLIBCXX_TYPE_INT_N_3)
2056 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
2057 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
2061 template<
typename _Tp,
2063 bool _IsEnum = __is_enum(_Tp)>
2064 class __make_signed_selector;
2066 template<
typename _Tp>
2067 class __make_signed_selector<_Tp, true, false>
2070 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2074 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2078 template<
typename _Tp>
2079 class __make_signed_selector<_Tp, false, true>
2081 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2084 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2092 struct __make_signed<wchar_t>
2095 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2098#if defined(_GLIBCXX_USE_CHAR8_T)
2100 struct __make_signed<char8_t>
2103 =
typename __make_signed_selector<char8_t, false, true>::__type;
2108 struct __make_signed<char16_t>
2111 =
typename __make_signed_selector<char16_t, false, true>::__type;
2115 struct __make_signed<char32_t>
2118 =
typename __make_signed_selector<char32_t, false, true>::__type;
2126 template<
typename _Tp>
2128 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2134 template<>
struct make_signed<bool const volatile>;
2136#if __cplusplus > 201103L
2138 template<
typename _Tp>
2142 template<
typename _Tp>
2149#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent)
2150 template<
typename _Tp>
2152 {
using type = __remove_extent(_Tp); };
2154 template<
typename _Tp>
2156 {
using type = _Tp; };
2158 template<
typename _Tp, std::
size_t _Size>
2159 struct remove_extent<_Tp[_Size]>
2160 {
using type = _Tp; };
2162 template<
typename _Tp>
2164 {
using type = _Tp; };
2168#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_all_extents)
2169 template<
typename _Tp>
2171 {
using type = __remove_all_extents(_Tp); };
2173 template<
typename _Tp>
2175 {
using type = _Tp; };
2177 template<
typename _Tp, std::
size_t _Size>
2178 struct remove_all_extents<_Tp[_Size]>
2179 {
using type =
typename remove_all_extents<_Tp>::type; };
2181 template<
typename _Tp>
2183 {
using type =
typename remove_all_extents<_Tp>::type; };
2186#if __cplusplus > 201103L
2188 template<
typename _Tp>
2192 template<
typename _Tp>
2199#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2200 template<
typename _Tp>
2202 {
using type = __remove_pointer(_Tp); };
2204 template<
typename _Tp,
typename>
2205 struct __remove_pointer_helper
2206 {
using type = _Tp; };
2208 template<
typename _Tp,
typename _Up>
2209 struct __remove_pointer_helper<_Tp, _Up*>
2210 {
using type = _Up; };
2212 template<
typename _Tp>
2214 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2219#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_pointer)
2220 template<
typename _Tp>
2222 {
using type = __add_pointer(_Tp); };
2224 template<
typename _Tp,
typename =
void>
2225 struct __add_pointer_helper
2226 {
using type = _Tp; };
2228 template<
typename _Tp>
2229 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2230 {
using type = _Tp*; };
2232 template<
typename _Tp>
2234 :
public __add_pointer_helper<_Tp>
2237 template<
typename _Tp>
2239 {
using type = _Tp*; };
2241 template<
typename _Tp>
2243 {
using type = _Tp*; };
2246#if __cplusplus > 201103L
2248 template<
typename _Tp>
2252 template<
typename _Tp>
2259 struct __attribute__((__aligned__)) __aligned_storage_max_align_t
2263 __aligned_storage_default_alignment([[__maybe_unused__]]
size_t __len)
2265#if _GLIBCXX_INLINE_VERSION
2267 = integral_constant<size_t,
alignof(__aligned_storage_max_align_t)>;
2269 return __len > (_Max_align::value / 2)
2271#
if _GLIBCXX_USE_BUILTIN_TRAIT(__builtin_clzg)
2272 : 1 << (__SIZE_WIDTH__ - __builtin_clzg(__len - 1u));
2274 : 1 << (__LLONG_WIDTH__ - __builtin_clzll(__len - 1ull));
2279 return alignof(__aligned_storage_max_align_t);
2315 template<
size_t _Len,
2316 size_t _Align = __aligned_storage_default_alignment(_Len)>
2318 _GLIBCXX23_DEPRECATED
2323 alignas(_Align)
unsigned char __data[_Len];
2327 template <
typename... _Types>
2328 struct __strictest_alignment
2330 static const size_t _S_alignment = 0;
2331 static const size_t _S_size = 0;
2334 template <
typename _Tp,
typename... _Types>
2335 struct __strictest_alignment<_Tp, _Types...>
2337 static const size_t _S_alignment =
2338 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2339 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2340 static const size_t _S_size =
2341 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2342 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2345#pragma GCC diagnostic push
2346#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2360 template <
size_t _Len,
typename... _Types>
2362 _GLIBCXX23_DEPRECATED
2366 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2368 using __strictest = __strictest_alignment<_Types...>;
2369 static const size_t _S_len = _Len > __strictest::_S_size
2370 ? _Len : __strictest::_S_size;
2375 using type =
typename aligned_storage<_S_len, alignment_value>::type;
2378 template <
size_t _Len,
typename... _Types>
2379 const size_t aligned_union<_Len, _Types...>::alignment_value;
2380#pragma GCC diagnostic pop
2384#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
2385 template<
typename _Tp>
2387 {
using type = __decay(_Tp); };
2391 template<
typename _Up>
2392 struct __decay_selector
2393 : __conditional_t<is_const<const _Up>::value,
2398 template<
typename _Up,
size_t _Nm>
2399 struct __decay_selector<_Up[_Nm]>
2400 {
using type = _Up*; };
2402 template<
typename _Up>
2403 struct __decay_selector<_Up[]>
2404 {
using type = _Up*; };
2409 template<
typename _Tp>
2411 {
using type =
typename __decay_selector<_Tp>::type; };
2413 template<
typename _Tp>
2415 {
using type =
typename __decay_selector<_Tp>::type; };
2417 template<
typename _Tp>
2419 {
using type =
typename __decay_selector<_Tp>::type; };
2425 template<
typename _Tp>
2426 struct __strip_reference_wrapper
2431 template<
typename _Tp>
2434 using __type = _Tp&;
2438 template<
typename _Tp>
2439 using __decay_t =
typename decay<_Tp>::type;
2441 template<
typename _Tp>
2442 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2448 template<
typename... _Cond>
2449 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2452 template<
typename _Tp>
2453 using __remove_cvref_t
2459 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2461 {
using type = _Iftrue; };
2464 template<
typename _Iftrue,
typename _Iffalse>
2466 {
using type = _Iffalse; };
2469 template<
typename... _Tp>
2481 template<
typename _Tp>
2482 struct __success_type
2483 {
using type = _Tp; };
2485 struct __failure_type
2488 struct __do_common_type_impl
2490 template<
typename _Tp,
typename _Up>
2496 template<
typename _Tp,
typename _Up>
2497 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2500#if __cplusplus > 201703L
2503 template<
typename _Tp,
typename _Up>
2504 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2508 template<
typename,
typename>
2509 static __failure_type
2512 template<
typename _Tp,
typename _Up>
2513 static decltype(_S_test_2<_Tp, _Up>(0))
2523 template<
typename _Tp0>
2529 template<
typename _Tp1,
typename _Tp2,
2530 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2531 struct __common_type_impl
2535 using type = common_type<_Dp1, _Dp2>;
2538 template<
typename _Tp1,
typename _Tp2>
2539 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2540 :
private __do_common_type_impl
2544 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2548 template<
typename _Tp1,
typename _Tp2>
2550 :
public __common_type_impl<_Tp1, _Tp2>::type
2553 template<
typename...>
2554 struct __common_type_pack
2557 template<
typename,
typename,
typename =
void>
2558 struct __common_type_fold;
2561 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2563 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2564 __common_type_pack<_Rp...>>
2570 template<
typename _CTp,
typename... _Rp>
2571 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2572 __void_t<typename _CTp::
type>>
2577 template<
typename _CTp,
typename _Rp>
2578 struct __common_type_fold<_CTp, _Rp, void>
2581 template<
typename _Tp,
bool = __is_enum(_Tp)>
2582 struct __underlying_type_impl
2584 using type = __underlying_type(_Tp);
2587 template<
typename _Tp>
2588 struct __underlying_type_impl<_Tp, false>
2593 template<
typename _Tp>
2595 :
public __underlying_type_impl<_Tp>
2599 template<
typename _Tp>
2600 struct __declval_protector
2602 static const bool __stop =
false;
2610 template<
typename _Tp>
2611 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2613 static_assert(__declval_protector<_Tp>::__stop,
2614 "declval() must not be used!");
2615 return __declval<_Tp>(0);
2619 template<
typename _Signature>
2625 struct __invoke_memfun_ref { };
2626 struct __invoke_memfun_deref { };
2627 struct __invoke_memobj_ref { };
2628 struct __invoke_memobj_deref { };
2629 struct __invoke_other { };
2632 template<
typename _Tp,
typename _Tag>
2633 struct __result_of_success : __success_type<_Tp>
2634 {
using __invoke_type = _Tag; };
2637 struct __result_of_memfun_ref_impl
2639 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2640 static __result_of_success<
decltype(
2642 ), __invoke_memfun_ref> _S_test(
int);
2644 template<
typename...>
2645 static __failure_type _S_test(...);
2648 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2649 struct __result_of_memfun_ref
2650 :
private __result_of_memfun_ref_impl
2652 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2656 struct __result_of_memfun_deref_impl
2658 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2659 static __result_of_success<
decltype(
2661 ), __invoke_memfun_deref> _S_test(
int);
2663 template<
typename...>
2664 static __failure_type _S_test(...);
2667 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2668 struct __result_of_memfun_deref
2669 :
private __result_of_memfun_deref_impl
2671 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2675 struct __result_of_memobj_ref_impl
2677 template<
typename _Fp,
typename _Tp1>
2678 static __result_of_success<
decltype(
2680 ), __invoke_memobj_ref> _S_test(
int);
2682 template<
typename,
typename>
2683 static __failure_type _S_test(...);
2686 template<
typename _MemPtr,
typename _Arg>
2687 struct __result_of_memobj_ref
2688 :
private __result_of_memobj_ref_impl
2690 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2694 struct __result_of_memobj_deref_impl
2696 template<
typename _Fp,
typename _Tp1>
2697 static __result_of_success<
decltype(
2699 ), __invoke_memobj_deref> _S_test(
int);
2701 template<
typename,
typename>
2702 static __failure_type _S_test(...);
2705 template<
typename _MemPtr,
typename _Arg>
2706 struct __result_of_memobj_deref
2707 :
private __result_of_memobj_deref_impl
2709 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2712 template<
typename _MemPtr,
typename _Arg>
2713 struct __result_of_memobj;
2715 template<
typename _Res,
typename _Class,
typename _Arg>
2716 struct __result_of_memobj<_Res _Class::*, _Arg>
2718 using _Argval = __remove_cvref_t<_Arg>;
2719 using _MemPtr = _Res _Class::*;
2720 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2721 is_base_of<_Class, _Argval>>::value,
2722 __result_of_memobj_ref<_MemPtr, _Arg>,
2723 __result_of_memobj_deref<_MemPtr, _Arg>
2727 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2728 struct __result_of_memfun;
2730 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2731 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2733 using _Argval =
typename remove_reference<_Arg>::type;
2734 using _MemPtr = _Res _Class::*;
2735 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2736 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2737 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2746 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2752 template<
typename _Tp,
typename _Up>
2758 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2759 struct __result_of_impl
2761 using type = __failure_type;
2764 template<
typename _MemPtr,
typename _Arg>
2765 struct __result_of_impl<true, false, _MemPtr, _Arg>
2766 :
public __result_of_memobj<__decay_t<_MemPtr>,
2767 typename __inv_unwrap<_Arg>::type>
2770 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2771 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2772 :
public __result_of_memfun<__decay_t<_MemPtr>,
2773 typename __inv_unwrap<_Arg>::type, _Args...>
2777 struct __result_of_other_impl
2779 template<
typename _Fn,
typename... _Args>
2780 static __result_of_success<
decltype(
2782 ), __invoke_other> _S_test(
int);
2784 template<
typename...>
2785 static __failure_type _S_test(...);
2788 template<
typename _Functor,
typename... _ArgTypes>
2789 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2790 :
private __result_of_other_impl
2792 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2796 template<
typename _Functor,
typename... _ArgTypes>
2797 struct __invoke_result
2798 :
public __result_of_impl<
2799 is_member_object_pointer<
2800 typename remove_reference<_Functor>::type
2802 is_member_function_pointer<
2803 typename remove_reference<_Functor>::type
2805 _Functor, _ArgTypes...
2810 template<
typename _Fn,
typename... _Args>
2811 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2814 template<
typename _Functor,
typename... _ArgTypes>
2815 struct result_of<_Functor(_ArgTypes...)>
2816 :
public __invoke_result<_Functor, _ArgTypes...>
2817 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2819#if __cplusplus >= 201402L
2820#pragma GCC diagnostic push
2821#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2823 template<
size_t _Len,
2824 size_t _Align = __aligned_storage_default_alignment(_Len)>
2825 using aligned_storage_t _GLIBCXX23_DEPRECATED =
typename aligned_storage<_Len, _Align>::type;
2827 template <
size_t _Len,
typename... _Types>
2828 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>
::type;
2829#pragma GCC diagnostic pop
2832 template<
typename _Tp>
2833 using decay_t =
typename decay<_Tp>::type;
2836 template<
bool _Cond,
typename _Tp =
void>
2840 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2841 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2844 template<
typename... _Tp>
2848 template<
typename _Tp>
2852 template<
typename _Tp>
2856#ifdef __cpp_lib_void_t
2858 template<typename...> using void_t = void;
2868 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2869 struct __detected_or
2876 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2877 requires requires {
typename _Op<_Args...>; }
2878 struct __detected_or<_Def, _Op, _Args...>
2880 using type = _Op<_Args...>;
2885 template<
typename _Default,
typename _AlwaysVoid,
2886 template<
typename...>
class _Op,
typename... _Args>
2889 using type = _Default;
2894 template<
typename _Default,
template<
typename...>
class _Op,
2896 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2898 using type = _Op<_Args...>;
2902 template<
typename _Default,
template<
typename...>
class _Op,
2904 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2908 template<
typename _Default,
template<
typename...>
class _Op,
2910 using __detected_or_t
2911 =
typename __detected_or<_Default, _Op, _Args...>::type;
2917#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2918 template<typename _Tp, typename = __void_t<>> \
2919 struct __has_##_NTYPE \
2922 template<typename _Tp> \
2923 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2927 template <
typename _Tp>
2928 struct __is_swappable;
2930 template <
typename _Tp>
2931 struct __is_nothrow_swappable;
2938 template<
typename _Tp>
2939 struct __is_tuple_like
2940 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2944 template<
typename _Tp>
2945 _GLIBCXX20_CONSTEXPR
2947 _Require<__not_<__is_tuple_like<_Tp>>,
2951 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2954 template<
typename _Tp,
size_t _Nm>
2955 _GLIBCXX20_CONSTEXPR
2957 __enable_if_t<__is_swappable<_Tp>::value>
2958 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2959 noexcept(__is_nothrow_swappable<_Tp>::value);
2962 namespace __swappable_details {
2965 struct __do_is_swappable_impl
2967 template<
typename _Tp,
typename
2969 static true_type __test(
int);
2975 struct __do_is_nothrow_swappable_impl
2977 template<
typename _Tp>
2978 static __bool_constant<
2988 template<
typename _Tp>
2989 struct __is_swappable_impl
2990 :
public __swappable_details::__do_is_swappable_impl
2992 using type =
decltype(__test<_Tp>(0));
2995 template<
typename _Tp>
2996 struct __is_nothrow_swappable_impl
2997 :
public __swappable_details::__do_is_nothrow_swappable_impl
2999 using type =
decltype(__test<_Tp>(0));
3002 template<
typename _Tp>
3003 struct __is_swappable
3004 :
public __is_swappable_impl<_Tp>::type
3007 template<
typename _Tp>
3008 struct __is_nothrow_swappable
3009 :
public __is_nothrow_swappable_impl<_Tp>::type
3013#ifdef __cpp_lib_is_swappable
3017 template<
typename _Tp>
3019 :
public __is_swappable_impl<_Tp>::type
3021 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3022 "template argument must be a complete class or an unbounded array");
3026 template<
typename _Tp>
3027 struct is_nothrow_swappable
3028 :
public __is_nothrow_swappable_impl<_Tp>::type
3030 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3031 "template argument must be a complete class or an unbounded array");
3034#if __cplusplus >= 201402L
3036 template<
typename _Tp>
3037 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
3038 is_swappable<_Tp>::value;
3041 template<
typename _Tp>
3042 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
3043 is_nothrow_swappable<_Tp>::value;
3047 namespace __swappable_with_details {
3050 struct __do_is_swappable_with_impl
3052 template<
typename _Tp,
typename _Up,
typename
3058 template<
typename,
typename>
3062 struct __do_is_nothrow_swappable_with_impl
3064 template<
typename _Tp,
typename _Up>
3065 static __bool_constant<
3071 template<
typename,
typename>
3077 template<
typename _Tp,
typename _Up>
3078 struct __is_swappable_with_impl
3079 :
public __swappable_with_details::__do_is_swappable_with_impl
3081 using type =
decltype(__test<_Tp, _Up>(0));
3085 template<
typename _Tp>
3086 struct __is_swappable_with_impl<_Tp&, _Tp&>
3087 :
public __swappable_details::__do_is_swappable_impl
3089 using type =
decltype(__test<_Tp&>(0));
3092 template<
typename _Tp,
typename _Up>
3093 struct __is_nothrow_swappable_with_impl
3094 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
3096 using type =
decltype(__test<_Tp, _Up>(0));
3100 template<
typename _Tp>
3101 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
3102 :
public __swappable_details::__do_is_nothrow_swappable_impl
3104 using type =
decltype(__test<_Tp&>(0));
3109 template<
typename _Tp,
typename _Up>
3110 struct is_swappable_with
3111 :
public __is_swappable_with_impl<_Tp, _Up>::type
3113 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3114 "first template argument must be a complete class or an unbounded array");
3115 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3116 "second template argument must be a complete class or an unbounded array");
3120 template<
typename _Tp,
typename _Up>
3121 struct is_nothrow_swappable_with
3122 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
3124 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3125 "first template argument must be a complete class or an unbounded array");
3126 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3127 "second template argument must be a complete class or an unbounded array");
3130#if __cplusplus >= 201402L
3132 template<
typename _Tp,
typename _Up>
3133 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3134 is_swappable_with<_Tp, _Up>::value;
3137 template<
typename _Tp,
typename _Up>
3138 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3139 is_nothrow_swappable_with<_Tp, _Up>::value;
3149 template<
typename _Result,
typename _Ret,
3151 struct __is_invocable_impl
3158 template<
typename _Result,
typename _Ret>
3159 struct __is_invocable_impl<_Result, _Ret,
3161 __void_t<typename _Result::
type>>
3167#pragma GCC diagnostic push
3168#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3170 template<
typename _Result,
typename _Ret>
3171 struct __is_invocable_impl<_Result, _Ret,
3173 __void_t<typename _Result::
type>>
3177 using _Res_t =
typename _Result::type;
3181 static _Res_t _S_get() noexcept;
3184 template<typename _Tp>
3185 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3188 template<typename _Tp,
3189 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3190 typename = decltype(_S_conv<_Tp>(_S_get())),
3191#if __has_builtin(__reference_converts_from_temporary)
3192 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3194 bool _Dangle =
false
3197 static __bool_constant<_Nothrow && !_Dangle>
3200 template<
typename _Tp,
bool = false>
3206 using type =
decltype(_S_test<_Ret,
true>(1));
3209 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3211#pragma GCC diagnostic pop
3213 template<
typename _Fn,
typename... _ArgTypes>
3214 struct __is_invocable
3215 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3218 template<
typename _Fn,
typename _Tp,
typename... _Args>
3219 constexpr bool __call_is_nt(__invoke_memfun_ref)
3221 using _Up =
typename __inv_unwrap<_Tp>::type;
3226 template<
typename _Fn,
typename _Tp,
typename... _Args>
3227 constexpr bool __call_is_nt(__invoke_memfun_deref)
3233 template<
typename _Fn,
typename _Tp>
3234 constexpr bool __call_is_nt(__invoke_memobj_ref)
3236 using _Up =
typename __inv_unwrap<_Tp>::type;
3240 template<
typename _Fn,
typename _Tp>
3241 constexpr bool __call_is_nt(__invoke_memobj_deref)
3246 template<
typename _Fn,
typename... _Args>
3247 constexpr bool __call_is_nt(__invoke_other)
3252 template<
typename _Result,
typename _Fn,
typename... _Args>
3253 struct __call_is_nothrow
3255 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3259 template<
typename _Fn,
typename... _Args>
3260 using __call_is_nothrow_
3261 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3264 template<
typename _Fn,
typename... _Args>
3265 struct __is_nothrow_invocable
3266 : __and_<__is_invocable<_Fn, _Args...>,
3267 __call_is_nothrow_<_Fn, _Args...>>::type
3270#pragma GCC diagnostic push
3271#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3272 struct __nonesuchbase {};
3273 struct __nonesuch :
private __nonesuchbase {
3274 ~__nonesuch() =
delete;
3275 __nonesuch(__nonesuch
const&) =
delete;
3276 void operator=(__nonesuch
const&) =
delete;
3278#pragma GCC diagnostic pop
3281#ifdef __cpp_lib_is_invocable
3283 template<typename _Functor, typename... _ArgTypes>
3284 struct invoke_result
3285 :
public __invoke_result<_Functor, _ArgTypes...>
3287 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3288 "_Functor must be a complete class or an unbounded array");
3289 static_assert((std::__is_complete_or_unbounded(
3290 __type_identity<_ArgTypes>{}) && ...),
3291 "each argument type must be a complete class or an unbounded array");
3295 template<
typename _Fn,
typename... _Args>
3296 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3299 template<
typename _Fn,
typename... _ArgTypes>
3301#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3302 :
public __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3304 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3307 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3308 "_Fn must be a complete class or an unbounded array");
3309 static_assert((std::__is_complete_or_unbounded(
3310 __type_identity<_ArgTypes>{}) && ...),
3311 "each argument type must be a complete class or an unbounded array");
3315 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3316 struct is_invocable_r
3317 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3319 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3320 "_Fn must be a complete class or an unbounded array");
3321 static_assert((std::__is_complete_or_unbounded(
3322 __type_identity<_ArgTypes>{}) && ...),
3323 "each argument type must be a complete class or an unbounded array");
3324 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3325 "_Ret must be a complete class or an unbounded array");
3329 template<
typename _Fn,
typename... _ArgTypes>
3330 struct is_nothrow_invocable
3331#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3332 :
public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)>
3334 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3335 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3338 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3339 "_Fn must be a complete class or an unbounded array");
3340 static_assert((std::__is_complete_or_unbounded(
3341 __type_identity<_ArgTypes>{}) && ...),
3342 "each argument type must be a complete class or an unbounded array");
3349 template<
typename _Result,
typename _Ret>
3350 using __is_nt_invocable_impl
3351 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3355 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3356 struct is_nothrow_invocable_r
3357 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3358 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3360 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3361 "_Fn must be a complete class or an unbounded array");
3362 static_assert((std::__is_complete_or_unbounded(
3363 __type_identity<_ArgTypes>{}) && ...),
3364 "each argument type must be a complete class or an unbounded array");
3365 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3366 "_Ret must be a complete class or an unbounded array");
3370#if __cpp_lib_type_trait_variable_templates
3385template <
typename _Tp>
3387template <
typename _Tp>
3388 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3389template <
typename _Tp>
3391template <
typename _Tp>
3394#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3395template <
typename _Tp>
3396 inline constexpr bool is_array_v = __is_array(_Tp);
3398template <
typename _Tp>
3399 inline constexpr bool is_array_v =
false;
3400template <
typename _Tp>
3401 inline constexpr bool is_array_v<_Tp[]> =
true;
3402template <
typename _Tp,
size_t _Num>
3403 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3406#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
3407template <
typename _Tp>
3408 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
3410template <
typename _Tp>
3411 inline constexpr bool is_pointer_v =
false;
3412template <
typename _Tp>
3413 inline constexpr bool is_pointer_v<_Tp*> =
true;
3414template <
typename _Tp>
3415 inline constexpr bool is_pointer_v<_Tp* const> =
true;
3416template <
typename _Tp>
3417 inline constexpr bool is_pointer_v<_Tp* volatile> =
true;
3418template <
typename _Tp>
3419 inline constexpr bool is_pointer_v<_Tp* const volatile> =
true;
3422template <
typename _Tp>
3423 inline constexpr bool is_lvalue_reference_v =
false;
3424template <
typename _Tp>
3425 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3426template <
typename _Tp>
3427 inline constexpr bool is_rvalue_reference_v =
false;
3428template <
typename _Tp>
3429 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3431#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3432template <
typename _Tp>
3433 inline constexpr bool is_member_object_pointer_v =
3434 __is_member_object_pointer(_Tp);
3436template <
typename _Tp>
3437 inline constexpr bool is_member_object_pointer_v =
3441#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3442template <
typename _Tp>
3443 inline constexpr bool is_member_function_pointer_v =
3444 __is_member_function_pointer(_Tp);
3446template <
typename _Tp>
3447 inline constexpr bool is_member_function_pointer_v =
3451template <
typename _Tp>
3452 inline constexpr bool is_enum_v = __is_enum(_Tp);
3453template <
typename _Tp>
3454 inline constexpr bool is_union_v = __is_union(_Tp);
3455template <
typename _Tp>
3456 inline constexpr bool is_class_v = __is_class(_Tp);
3459#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3460template <
typename _Tp>
3461 inline constexpr bool is_reference_v = __is_reference(_Tp);
3463template <
typename _Tp>
3464 inline constexpr bool is_reference_v =
false;
3465template <
typename _Tp>
3466 inline constexpr bool is_reference_v<_Tp&> =
true;
3467template <
typename _Tp>
3468 inline constexpr bool is_reference_v<_Tp&&> =
true;
3471template <
typename _Tp>
3473template <
typename _Tp>
3476#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3477template <
typename _Tp>
3478 inline constexpr bool is_object_v = __is_object(_Tp);
3480template <
typename _Tp>
3484template <
typename _Tp>
3486template <
typename _Tp>
3487 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3489#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3490template <
typename _Tp>
3491 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3493template <
typename _Tp>
3497#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
3498template <
typename _Tp>
3499 inline constexpr bool is_const_v = __is_const(_Tp);
3501template <
typename _Tp>
3502 inline constexpr bool is_const_v =
false;
3503template <
typename _Tp>
3504 inline constexpr bool is_const_v<const _Tp> =
true;
3507#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3508template <
typename _Tp>
3509 inline constexpr bool is_function_v = __is_function(_Tp);
3511template <
typename _Tp>
3512 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3513template <
typename _Tp>
3514 inline constexpr bool is_function_v<_Tp&> =
false;
3515template <
typename _Tp>
3516 inline constexpr bool is_function_v<_Tp&&> =
false;
3519#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
3520template <
typename _Tp>
3521 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
3523template <
typename _Tp>
3524 inline constexpr bool is_volatile_v =
false;
3525template <
typename _Tp>
3526 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3529template <
typename _Tp>
3530 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible_v && is_trivially_copyable_v")
3531 inline constexpr
bool is_trivial_v = __is_trivial(_Tp);
3532template <typename _Tp>
3533 inline constexpr
bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3534template <typename _Tp>
3535 inline constexpr
bool is_standard_layout_v = __is_standard_layout(_Tp);
3536template <typename _Tp>
3537 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3538 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3539template <typename _Tp>
3540 _GLIBCXX17_DEPRECATED
3541 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3542template <typename _Tp>
3543 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3544template <typename _Tp>
3545 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3546template <typename _Tp>
3547 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3548template <typename _Tp>
3549 inline constexpr
bool is_final_v = __is_final(_Tp);
3551template <typename _Tp>
3552 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3553template <typename _Tp>
3554 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3556template <typename _Tp, typename... _Args>
3557 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3558template <typename _Tp>
3559 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3560template <typename _Tp>
3561 inline constexpr
bool is_copy_constructible_v
3562 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3563template <typename _Tp>
3564 inline constexpr
bool is_move_constructible_v
3565 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3567template <typename _Tp, typename _Up>
3568 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3569template <typename _Tp>
3570 inline constexpr
bool is_copy_assignable_v
3571 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3572template <typename _Tp>
3573 inline constexpr
bool is_move_assignable_v
3574 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3576template <typename _Tp>
3577 inline constexpr
bool is_destructible_v =
is_destructible<_Tp>::value;
3579template <typename _Tp, typename... _Args>
3580 inline constexpr
bool is_trivially_constructible_v
3581 = __is_trivially_constructible(_Tp, _Args...);
3582template <typename _Tp>
3583 inline constexpr
bool is_trivially_default_constructible_v
3584 = __is_trivially_constructible(_Tp);
3585template <typename _Tp>
3586 inline constexpr
bool is_trivially_copy_constructible_v
3587 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3588template <typename _Tp>
3589 inline constexpr
bool is_trivially_move_constructible_v
3590 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3592template <typename _Tp, typename _Up>
3593 inline constexpr
bool is_trivially_assignable_v
3594 = __is_trivially_assignable(_Tp, _Up);
3595template <typename _Tp>
3596 inline constexpr
bool is_trivially_copy_assignable_v
3597 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3598 __add_lval_ref_t<const _Tp>);
3599template <typename _Tp>
3600 inline constexpr
bool is_trivially_move_assignable_v
3601 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3602 __add_rval_ref_t<_Tp>);
3605template <
typename _Tp>
3606 inline constexpr bool is_trivially_destructible_v =
false;
3608template <
typename _Tp>
3609 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3610 inline constexpr bool is_trivially_destructible_v<_Tp>
3611 = __has_trivial_destructor(_Tp);
3612template <
typename _Tp>
3613 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3614template <
typename _Tp>
3615 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3616template <
typename _Tp,
size_t _Nm>
3617 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3618 = is_trivially_destructible_v<_Tp>;
3620template <
typename _Tp>
3621 inline constexpr bool is_trivially_destructible_v =
3625template <
typename _Tp,
typename... _Args>
3626 inline constexpr bool is_nothrow_constructible_v
3627 = __is_nothrow_constructible(_Tp, _Args...);
3628template <
typename _Tp>
3629 inline constexpr bool is_nothrow_default_constructible_v
3630 = __is_nothrow_constructible(_Tp);
3631template <
typename _Tp>
3632 inline constexpr bool is_nothrow_copy_constructible_v
3633 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3634template <
typename _Tp>
3635 inline constexpr bool is_nothrow_move_constructible_v
3636 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3638template <
typename _Tp,
typename _Up>
3639 inline constexpr bool is_nothrow_assignable_v
3640 = __is_nothrow_assignable(_Tp, _Up);
3641template <
typename _Tp>
3642 inline constexpr bool is_nothrow_copy_assignable_v
3643 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3644 __add_lval_ref_t<const _Tp>);
3645template <
typename _Tp>
3646 inline constexpr bool is_nothrow_move_assignable_v
3647 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3649template <
typename _Tp>
3650 inline constexpr bool is_nothrow_destructible_v =
3653template <
typename _Tp>
3654 inline constexpr bool has_virtual_destructor_v
3655 = __has_virtual_destructor(_Tp);
3657template <
typename _Tp>
3658 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3660#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
3661 && (!defined(__clang__) || __clang_major__ >= 20)
3662template <
typename _Tp>
3663 inline constexpr size_t rank_v = __array_rank(_Tp);
3665template <
typename _Tp>
3666 inline constexpr size_t rank_v = 0;
3667template <
typename _Tp,
size_t _Size>
3668 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3669template <
typename _Tp>
3670 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3673template <
typename _Tp,
unsigned _Idx = 0>
3674 inline constexpr size_t extent_v = 0;
3675template <
typename _Tp,
size_t _Size>
3676 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3677template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3678 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3679template <
typename _Tp>
3680 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3681template <
typename _Tp,
unsigned _Idx>
3682 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3684#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3685template <
typename _Tp,
typename _Up>
3686 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3688template <
typename _Tp,
typename _Up>
3689 inline constexpr bool is_same_v =
false;
3690template <
typename _Tp>
3691 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3693template <
typename _Base,
typename _Derived>
3694 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3695#ifdef __cpp_lib_is_virtual_base_of
3696template <
typename _Base,
typename _Derived>
3697 inline constexpr bool is_virtual_base_of_v = __builtin_is_virtual_base_of(_Base, _Derived);
3699#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3700template <
typename _From,
typename _To>
3701 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3703template <
typename _From,
typename _To>
3704 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3706template<
typename _Fn,
typename... _Args>
3707 inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
3708template<
typename _Fn,
typename... _Args>
3709 inline constexpr bool is_nothrow_invocable_v
3710 = is_nothrow_invocable<_Fn, _Args...>::value;
3711template<
typename _Ret,
typename _Fn,
typename... _Args>
3712 inline constexpr bool is_invocable_r_v
3713 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3714template<
typename _Ret,
typename _Fn,
typename... _Args>
3715 inline constexpr bool is_nothrow_invocable_r_v
3716 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3720#ifdef __cpp_lib_has_unique_object_representations
3723 template<typename _Tp>
3724 struct has_unique_object_representations
3725 : bool_constant<__has_unique_object_representations(
3726 remove_cv_t<remove_all_extents_t<_Tp>>
3729 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3730 "template argument must be a complete class or an unbounded array");
3733# if __cpp_lib_type_trait_variable_templates
3735 template<typename _Tp>
3736 inline constexpr bool has_unique_object_representations_v
3737 = has_unique_object_representations<_Tp>::value;
3741#ifdef __cpp_lib_is_aggregate
3744 template<typename _Tp>
3746 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3749# if __cpp_lib_type_trait_variable_templates
3754 template<
typename _Tp>
3755 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3763#ifdef __cpp_lib_remove_cvref
3764# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3765 template<
typename _Tp>
3767 {
using type = __remove_cvref(_Tp); };
3769 template<
typename _Tp>
3771 {
using type =
typename remove_cv<_Tp>::type; };
3773 template<
typename _Tp>
3774 struct remove_cvref<_Tp&>
3775 {
using type =
typename remove_cv<_Tp>::type; };
3777 template<
typename _Tp>
3778 struct remove_cvref<_Tp&&>
3779 {
using type =
typename remove_cv<_Tp>::type; };
3782 template<
typename _Tp>
3783 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3787#ifdef __cpp_lib_type_identity
3792 template<
typename _Tp>
3793 struct type_identity {
using type = _Tp; };
3795 template<
typename _Tp>
3796 using type_identity_t =
typename type_identity<_Tp>::type;
3800#ifdef __cpp_lib_unwrap_ref
3805 template<
typename _Tp>
3806 struct unwrap_reference {
using type = _Tp; };
3808 template<
typename _Tp>
3811 template<
typename _Tp>
3812 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3819 template<
typename _Tp>
3820 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3822 template<
typename _Tp>
3823 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3827#ifdef __cpp_lib_bounded_array_traits
3831# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
3832 template<
typename _Tp>
3833 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
3835 template<
typename _Tp>
3836 inline constexpr bool is_bounded_array_v =
false;
3838 template<
typename _Tp,
size_t _Size>
3839 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
3845# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
3846 template<
typename _Tp>
3847 inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
3849 template<
typename _Tp>
3850 inline constexpr bool is_unbounded_array_v =
false;
3852 template<
typename _Tp>
3853 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
3858 template<
typename _Tp>
3859 struct is_bounded_array
3860 :
public bool_constant<is_bounded_array_v<_Tp>>
3865 template<
typename _Tp>
3866 struct is_unbounded_array
3867 :
public bool_constant<is_unbounded_array_v<_Tp>>
3871#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
3874 template<
typename _Tp,
typename _Up>
3876 : bool_constant<__is_layout_compatible(_Tp, _Up)>
3881 template<
typename _Tp,
typename _Up>
3883 = __is_layout_compatible(_Tp, _Up);
3885#if __has_builtin(__builtin_is_corresponding_member)
3886# ifndef __cpp_lib_is_layout_compatible
3887# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
3891 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
3894 {
return __builtin_is_corresponding_member(__m1, __m2); }
3898#if __has_builtin(__is_pointer_interconvertible_base_of) \
3899 && __cplusplus >= 202002L
3902 template<
typename _Base,
typename _Derived>
3904 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
3909 template<
typename _Base,
typename _Derived>
3911 = __is_pointer_interconvertible_base_of(_Base, _Derived);
3913#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
3914# ifndef __cpp_lib_is_pointer_interconvertible
3915# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
3921 template<
typename _Tp,
typename _Mem>
3924 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
3928#ifdef __cpp_lib_is_scoped_enum
3932# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3933 template<
typename _Tp>
3934 struct is_scoped_enum
3935 : bool_constant<__is_scoped_enum(_Tp)>
3938 template<
typename _Tp>
3939 struct is_scoped_enum
3943 template<
typename _Tp>
3944 requires __is_enum(_Tp)
3945 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
3946 struct is_scoped_enum<_Tp>
3947 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3953# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3954 template<
typename _Tp>
3955 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
3957 template<
typename _Tp>
3958 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3962#ifdef __cpp_lib_reference_from_temporary
3967 template<typename _Tp, typename _Up>
3968 struct reference_constructs_from_temporary
3969 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
3971 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3972 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3973 "template argument must be a complete class or an unbounded array");
3980 template<
typename _Tp,
typename _Up>
3981 struct reference_converts_from_temporary
3982 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
3984 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3985 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3986 "template argument must be a complete class or an unbounded array");
3991 template<
typename _Tp,
typename _Up>
3992 inline constexpr bool reference_constructs_from_temporary_v
3993 = reference_constructs_from_temporary<_Tp, _Up>::value;
3997 template<
typename _Tp,
typename _Up>
3998 inline constexpr bool reference_converts_from_temporary_v
3999 = reference_converts_from_temporary<_Tp, _Up>::value;
4002#ifdef __cpp_lib_is_constant_evaluated
4005 constexpr inline bool
4006 is_constant_evaluated() noexcept
4008#if __cpp_if_consteval >= 202106L
4009 if consteval {
return true; }
else {
return false; }
4011 return __builtin_is_constant_evaluated();
4016#if __cplusplus >= 202002L
4018 template<
typename _From,
typename _To>
4019 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
4021 template<
typename _Xp,
typename _Yp>
4025 template<
typename _Ap,
typename _Bp,
typename =
void>
4026 struct __common_ref_impl
4030 template<
typename _Ap,
typename _Bp>
4031 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
4034 template<
typename _Xp,
typename _Yp>
4035 using __condres_cvref
4036 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
4039 template<
typename _Xp,
typename _Yp>
4040 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
4042 __condres_cvref<_Xp, _Yp>>
4046 template<
typename _Xp,
typename _Yp>
4050 template<
typename _Xp,
typename _Yp>
4051 struct __common_ref_impl<_Xp&&, _Yp&&,
4052 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
4053 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
4054 {
using type = __common_ref_C<_Xp, _Yp>; };
4057 template<
typename _Xp,
typename _Yp>
4058 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
4061 template<
typename _Xp,
typename _Yp>
4062 struct __common_ref_impl<_Xp&&, _Yp&,
4063 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
4064 {
using type = __common_ref_D<_Xp, _Yp>; };
4067 template<
typename _Xp,
typename _Yp>
4068 struct __common_ref_impl<_Xp&, _Yp&&>
4069 : __common_ref_impl<_Yp&&, _Xp&>
4073 template<
typename _Tp,
typename _Up,
4074 template<
typename>
class _TQual,
template<
typename>
class _UQual>
4075 struct basic_common_reference
4079 template<
typename _Tp>
4081 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
4083 template<
typename _Tp>
4085 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
4087 template<
typename _Tp>
4088 struct __xref<_Tp&&>
4089 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
4091 template<
typename _Tp1,
typename _Tp2>
4092 using __basic_common_ref
4093 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
4094 remove_cvref_t<_Tp2>,
4095 __xref<_Tp1>::template __type,
4096 __xref<_Tp2>::template __type>::type;
4099 template<
typename... _Tp>
4100 struct common_reference;
4102 template<
typename... _Tp>
4107 struct common_reference<>
4111 template<
typename _Tp0>
4112 struct common_reference<_Tp0>
4113 {
using type = _Tp0; };
4116 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
4117 struct __common_reference_impl
4118 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
4122 template<
typename _Tp1,
typename _Tp2>
4123 struct common_reference<_Tp1, _Tp2>
4124 : __common_reference_impl<_Tp1, _Tp2>
4128 template<
typename _Tp1,
typename _Tp2>
4129 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
4130 void_t<__common_ref<_Tp1&, _Tp2&>>>
4131 {
using type = __common_ref<_Tp1&, _Tp2&>; };
4133 template<
typename _Tp1,
typename _Tp2>
4134 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
4135 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
4136 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
4138 template<
typename _Tp1,
typename _Tp2>
4139 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
4140 void_t<__common_ref<_Tp1&, _Tp2&&>>>
4141 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
4143 template<
typename _Tp1,
typename _Tp2>
4144 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
4145 void_t<__common_ref<_Tp1&&, _Tp2&>>>
4146 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
4149 template<
typename _Tp1,
typename _Tp2>
4150 struct __common_reference_impl<_Tp1, _Tp2, 2,
4151 void_t<__basic_common_ref<_Tp1, _Tp2>>>
4152 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
4155 template<
typename _Tp1,
typename _Tp2>
4156 struct __common_reference_impl<_Tp1, _Tp2, 3,
4157 void_t<__cond_res<_Tp1, _Tp2>>>
4158 {
using type = __cond_res<_Tp1, _Tp2>; };
4161 template<
typename _Tp1,
typename _Tp2>
4162 struct __common_reference_impl<_Tp1, _Tp2, 4,
4164 {
using type = common_type_t<_Tp1, _Tp2>; };
4167 template<
typename _Tp1,
typename _Tp2>
4168 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
4172 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4173 struct common_reference<_Tp1, _Tp2, _Rest...>
4174 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4175 __common_type_pack<_Rest...>>
4179 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4180 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4181 __common_type_pack<_Rest...>,
4183 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4191_GLIBCXX_END_NAMESPACE_VERSION
static const size_t alignment_value
The value of the strictest alignment of _Types.
constexpr bool is_corresponding_member(_M1 _S1::*__m1, _M2 _S2::*__m2) noexcept
typename common_reference< _Tp... >::type common_reference_t
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
typename aligned_storage< _S_len, alignment_value >::type type
The storage.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
constexpr bool is_pointer_interconvertible_with_class(_Mem _Tp::*__mp) noexcept
True if __mp points to the first member of a standard-layout type.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
constexpr bool is_layout_compatible_v
constexpr bool is_pointer_interconvertible_base_of_v
typename decay< _Tp >::type decay_t
Alias template for decay.
auto declval() noexcept -> decltype(__declval< _Tp >(0))
void void_t
A metafunction that always yields void, used for detecting valid types.
ISO C++ entities toplevel namespace is std.
Implementation details not part of the namespace std interface.
Primary class template for reference_wrapper.
Define a member typedef type only if a boolean constant is true.
is_member_function_pointer
is_nothrow_default_constructible
is_nothrow_copy_constructible
is_nothrow_move_constructible
is_nothrow_copy_assignable
is_nothrow_move_assignable
is_trivially_constructible
is_trivially_default_constructible
is_trivially_copy_constructible
is_trivially_move_constructible
is_trivially_copy_assignable
is_trivially_move_assignable
is_trivially_destructible
Provide aligned storage for types.
Define a member typedef type to one of two argument types.
The underlying type of an enum.
True if _Derived is standard-layout and has a base class of type _Base