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_common_reference
45#define __glibcxx_want_has_unique_object_representations
46#define __glibcxx_want_integral_constant_callable
47#define __glibcxx_want_is_aggregate
48#define __glibcxx_want_is_constant_evaluated
49#define __glibcxx_want_is_final
50#define __glibcxx_want_is_implicit_lifetime
51#define __glibcxx_want_is_invocable
52#define __glibcxx_want_is_layout_compatible
53#define __glibcxx_want_is_nothrow_convertible
54#define __glibcxx_want_is_null_pointer
55#define __glibcxx_want_is_pointer_interconvertible
56#define __glibcxx_want_is_scoped_enum
57#define __glibcxx_want_is_structural
58#define __glibcxx_want_is_swappable
59#define __glibcxx_want_is_virtual_base_of
60#define __glibcxx_want_logical_traits
61#define __glibcxx_want_reference_from_temporary
62#define __glibcxx_want_remove_cvref
63#define __glibcxx_want_result_of_sfinae
64#define __glibcxx_want_transformation_trait_aliases
65#define __glibcxx_want_type_identity
66#define __glibcxx_want_type_trait_variable_templates
67#define __glibcxx_want_unwrap_ref
68#define __glibcxx_want_void_t
73namespace std _GLIBCXX_VISIBILITY(default)
75_GLIBCXX_BEGIN_NAMESPACE_VERSION
77 template<
typename _Tp>
94 template<
typename _Tp, _Tp __v>
97 static constexpr _Tp value = __v;
98 using value_type = _Tp;
100 constexpr operator value_type()
const noexcept {
return value; }
102#ifdef __cpp_lib_integral_constant_callable
103 constexpr value_type operator()()
const noexcept {
return value; }
107#if ! __cpp_inline_variables
108 template<
typename _Tp, _Tp __v>
109 constexpr _Tp integral_constant<_Tp, __v>::value;
124#ifdef __cpp_lib_bool_constant
128 using bool_constant = __bool_constant<__v>;
135 template<
bool,
typename _Tp =
void>
140 template<
typename _Tp>
142 {
using type = _Tp; };
145 template<
bool _Cond,
typename _Tp =
void>
146 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
151 template<
typename _Tp,
typename>
156 struct __conditional<false>
158 template<
typename,
typename _Up>
163 template<
bool _Cond,
typename _If,
typename _Else>
164 using __conditional_t
165 =
typename __conditional<_Cond>::template type<_If, _Else>;
167#ifdef __cpp_lib_type_identity
172 template<
typename _Tp>
173 struct type_identity {
using type = _Tp; };
175 template<
typename _Tp>
176 using type_identity_t =
typename type_identity<_Tp>::type;
180 template <
typename _Tp>
181 using __type_identity = type_identity<_Tp>;
183 template<
typename _Tp>
184 using __type_identity_t =
typename type_identity<_Tp>::type;
188 template <
typename _Type>
189 struct __type_identity
190 {
using type = _Type; };
192 template<
typename _Tp>
193 using __type_identity_t =
typename __type_identity<_Tp>::type;
201 template<
typename _Tp,
typename...>
202 using __first_t = _Tp;
205 template<
typename... _Bn>
207 __enable_if_t<!bool(_Bn::value)>...>;
209 template<
typename... _Bn>
212 template<
typename... _Bn>
213 auto __and_fn(
int) -> __first_t<
true_type,
214 __enable_if_t<bool(_Bn::value)>...>;
216 template<
typename... _Bn>
223 template<
typename... _Bn>
225 : decltype(__detail::__or_fn<_Bn...>(0))
228 template<
typename... _Bn>
230 : decltype(__detail::__and_fn<_Bn...>(0))
233 template<
typename _Pp>
235 : __bool_constant<!bool(_Pp::value)>
239#ifdef __cpp_lib_logical_traits
242 template<
typename... _Bn>
243 inline constexpr bool __or_v = __or_<_Bn...>::value;
244 template<
typename... _Bn>
245 inline constexpr bool __and_v = __and_<_Bn...>::value;
249 template<
typename ,
typename _B1,
typename... _Bn>
250 struct __disjunction_impl
251 {
using type = _B1; };
253 template<
typename _B1,
typename _B2,
typename... _Bn>
254 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
255 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
257 template<
typename ,
typename _B1,
typename... _Bn>
258 struct __conjunction_impl
259 {
using type = _B1; };
261 template<
typename _B1,
typename _B2,
typename... _Bn>
262 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
263 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
267 template<
typename... _Bn>
269 : __detail::__conjunction_impl<void, _Bn...>::type
277 template<
typename... _Bn>
279 : __detail::__disjunction_impl<void, _Bn...>::type
287 template<
typename _Pp>
295 template<
typename... _Bn>
296 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
298 template<
typename... _Bn>
299 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
301 template<
typename _Pp>
302 inline constexpr bool negation_v = negation<_Pp>::value;
317 struct __is_array_unknown_bounds;
322 template<
typename _Tp>
323 using __maybe_complete_object_type
324 = __and_<is_object<_Tp>, __not_<__is_array_unknown_bounds<_Tp>>>;
330 template<
typename _Tp,
331 typename = __enable_if_t<__maybe_complete_object_type<_Tp>::value>,
332 size_t =
sizeof(_Tp)>
334 __is_complete_or_unbounded(__type_identity<_Tp>)
339 template<
typename _TypeIdentity,
340 typename _NestedType =
typename _TypeIdentity::type>
341 constexpr typename __not_<__maybe_complete_object_type<_NestedType>>::type
342 __is_complete_or_unbounded(_TypeIdentity)
346 template<
typename _Tp>
347 using __remove_cv_t =
typename remove_cv<_Tp>::type;
353 template<
typename _Tp>
362 struct is_void<const void>
363 :
public true_type { };
370 struct is_void<const volatile void>
379 enum class _Integer_kind { _None, _Signed, _Unsigned };
382 struct __is_integral_helper
384 {
static constexpr auto _S_kind = _Integer_kind::_None; };
387 struct __is_integral_helper<bool>
389 {
static constexpr auto _S_kind = _Integer_kind::_None; };
392 struct __is_integral_helper<char>
394 {
static constexpr auto _S_kind = _Integer_kind::_None; };
397 struct __is_integral_helper<signed char>
399 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
402 struct __is_integral_helper<unsigned char>
404 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
410 struct __is_integral_helper<wchar_t>
412 {
static constexpr auto _S_kind = _Integer_kind::_None; };
414#ifdef _GLIBCXX_USE_CHAR8_T
416 struct __is_integral_helper<char8_t>
418 {
static constexpr auto _S_kind = _Integer_kind::_None; };
422 struct __is_integral_helper<char16_t>
424 {
static constexpr auto _S_kind = _Integer_kind::_None; };
427 struct __is_integral_helper<char32_t>
429 {
static constexpr auto _S_kind = _Integer_kind::_None; };
432 struct __is_integral_helper<short>
434 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
437 struct __is_integral_helper<unsigned short>
439 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
442 struct __is_integral_helper<int>
444 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
447 struct __is_integral_helper<unsigned int>
449 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
452 struct __is_integral_helper<long>
454 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
457 struct __is_integral_helper<unsigned long>
459 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
462 struct __is_integral_helper<long long>
464 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
467 struct __is_integral_helper<unsigned long long>
469 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
473#if defined(__GLIBCXX_TYPE_INT_N_0)
476 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
478 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
482 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
484 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
486#if defined(__GLIBCXX_TYPE_INT_N_1)
489 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
491 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
495 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
497 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
499#if defined(__GLIBCXX_TYPE_INT_N_2)
502 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
504 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
508 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
510 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
512#if defined(__GLIBCXX_TYPE_INT_N_3)
515 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
517 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
521 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
523 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
526#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
529 struct __is_integral_helper<__int128>
531 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
535 struct __is_integral_helper<unsigned __int128>
537 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
541 template<
typename _Tp>
542 using __is_signed_integer
543 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
544 == _Integer_kind::_Signed>;
547 template<
typename _Tp>
548 using __is_unsigned_integer
549 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
550 == _Integer_kind::_Unsigned>;
554 template<
typename _Tp>
555 using __is_signed_or_unsigned_integer
556 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
557 != _Integer_kind::_None>;
562 template<
typename _Tp>
564 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
569 struct __is_floating_point_helper
573 struct __is_floating_point_helper<float>
574 :
public true_type { };
577 struct __is_floating_point_helper<double>
581 struct __is_floating_point_helper<long double>
584#ifdef __STDCPP_FLOAT16_T__
586 struct __is_floating_point_helper<_Float16>
590#ifdef __STDCPP_FLOAT32_T__
592 struct __is_floating_point_helper<_Float32>
596#ifdef __STDCPP_FLOAT64_T__
598 struct __is_floating_point_helper<_Float64>
602#ifdef __STDCPP_FLOAT128_T__
604 struct __is_floating_point_helper<_Float128>
608#ifdef __STDCPP_BFLOAT16_T__
610 struct __is_floating_point_helper<__gnu_cxx::__bfloat16_t>
614#ifdef _GLIBCXX_USE_FLOAT128
616 struct __is_floating_point_helper<__float128>
622 template<
typename _Tp>
624 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
628#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
629 template<
typename _Tp>
631 :
public __bool_constant<__is_array(_Tp)>
638 template<
typename _Tp, std::
size_t _Size>
639 struct is_array<_Tp[_Size]>
640 :
public true_type { };
642 template<
typename _Tp>
648#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
649 template<
typename _Tp>
651 :
public __bool_constant<__is_pointer(_Tp)>
654 template<
typename _Tp>
658 template<
typename _Tp>
659 struct is_pointer<_Tp*>
660 :
public true_type { };
662 template<
typename _Tp>
666 template<
typename _Tp>
670 template<
typename _Tp>
680 template<
typename _Tp>
689 template<
typename _Tp>
694#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
695 template<
typename _Tp>
697 :
public __bool_constant<__is_member_object_pointer(_Tp)>
700 template<
typename _Tp>
704 struct __is_member_object_pointer_helper
707 template<
typename _Tp,
typename _Cp>
708 struct __is_member_object_pointer_helper<_Tp _Cp::*>
709 :
public __not_<is_function<_Tp>>::type { };
712 template<
typename _Tp>
714 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
718#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
720 template<
typename _Tp>
722 :
public __bool_constant<__is_member_function_pointer(_Tp)>
725 template<
typename _Tp>
729 struct __is_member_function_pointer_helper
732 template<
typename _Tp,
typename _Cp>
733 struct __is_member_function_pointer_helper<_Tp _Cp::*>
734 :
public is_function<_Tp>::type { };
737 template<
typename _Tp>
739 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
744 template<
typename _Tp>
746 :
public __bool_constant<__is_enum(_Tp)>
750 template<
typename _Tp>
752 :
public __bool_constant<__is_union(_Tp)>
756 template<
typename _Tp>
758 :
public __bool_constant<__is_class(_Tp)>
762#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
763 template<
typename _Tp>
765 :
public __bool_constant<__is_function(_Tp)>
768 template<
typename _Tp>
770 :
public __bool_constant<!is_const<const _Tp>::value> { };
772 template<
typename _Tp>
773 struct is_function<_Tp&>
774 :
public false_type { };
776 template<
typename _Tp>
781#if __cpp_impl_reflection >= 202506L
783 template<typename _Tp>
788 struct is_reflection<decltype(^^int)>
792 struct is_reflection<const decltype(^^int)>
796 struct is_reflection<volatile decltype(^^int)>
800 struct is_reflection<const volatile decltype(^^int)>
804#ifdef __cpp_lib_is_null_pointer
806 template<typename _Tp>
807 struct is_null_pointer
811 struct is_null_pointer<std::nullptr_t>
815 struct is_null_pointer<const std::nullptr_t>
819 struct is_null_pointer<volatile std::nullptr_t>
823 struct is_null_pointer<const volatile std::nullptr_t>
828 template<
typename _Tp>
829 struct __is_nullptr_t
830 :
public is_null_pointer<_Tp>
831 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
837#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
838 template<
typename _Tp>
840 :
public __bool_constant<__is_reference(_Tp)>
843 template<
typename _Tp>
848 template<
typename _Tp>
849 struct is_reference<_Tp&>
853 template<
typename _Tp>
860 template<
typename _Tp>
862 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
866 template<
typename _Tp>
868 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
870#if __cpp_impl_reflection >= 202506L
877#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
878 template<
typename _Tp>
880 :
public __bool_constant<__is_object(_Tp)>
883 template<
typename _Tp>
885 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
891 struct is_member_pointer;
894 template<
typename _Tp>
896 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
897 is_member_pointer<_Tp>, is_null_pointer<_Tp>
898#if __cpp_impl_reflection >= 202506L
905 template<
typename _Tp>
907 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
910#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
911 template<
typename _Tp>
913 :
public __bool_constant<__is_member_pointer(_Tp)>
917 template<
typename _Tp>
918 struct __is_member_pointer_helper
921 template<
typename _Tp,
typename _Cp>
922 struct __is_member_pointer_helper<_Tp _Cp::*>
923 :
public true_type { };
926 template<
typename _Tp>
928 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
932 template<
typename,
typename>
936 template<
typename _Tp,
typename... _Types>
937 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
940 template<
typename...>
using __void_t = void;
946#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
947 template<
typename _Tp>
949 :
public __bool_constant<__is_const(_Tp)>
956 template<
typename _Tp>
957 struct is_const<_Tp const>
958 :
public true_type { };
962#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
963 template<
typename _Tp>
965 :
public __bool_constant<__is_volatile(_Tp)>
972 template<
typename _Tp>
973 struct is_volatile<_Tp volatile>
974 :
public true_type { };
984 template<
typename _Tp>
986 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible && is_trivially_copyable")
988 : public __bool_constant<__is_trivial(_Tp)>
990 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
991 "template argument must be a complete class or an unbounded array");
995 template<
typename _Tp>
997 :
public __bool_constant<__is_trivially_copyable(_Tp)>
999 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1000 "template argument must be a complete class or an unbounded array");
1004 template<
typename _Tp>
1006 :
public __bool_constant<__is_standard_layout(_Tp)>
1008 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1009 "template argument must be a complete class or an unbounded array");
1017 template<
typename _Tp>
1019 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
1021 : public __bool_constant<__is_pod(_Tp)>
1023 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1024 "template argument must be a complete class or an unbounded array");
1031 template<
typename _Tp>
1033 _GLIBCXX17_DEPRECATED
1035 :
public __bool_constant<__is_literal_type(_Tp)>
1037 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1038 "template argument must be a complete class or an unbounded array");
1042 template<
typename _Tp>
1044 :
public __bool_constant<__is_empty(_Tp)>
1048 template<
typename _Tp>
1050 :
public __bool_constant<__is_polymorphic(_Tp)>
1053#ifdef __cpp_lib_is_final
1056 template<typename _Tp>
1058 :
public __bool_constant<__is_final(_Tp)>
1063 template<
typename _Tp>
1065 :
public __bool_constant<__is_abstract(_Tp)>
1069 template<
typename _Tp,
1071 struct __is_signed_helper
1074 template<
typename _Tp>
1075 struct __is_signed_helper<_Tp, true>
1076 :
public __bool_constant<_Tp(-1) < _Tp(0)>
1081 template<typename _Tp>
1083 : public __is_signed_helper<_Tp>::type
1087 template<typename _Tp>
1089 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
1093 template<typename _Tp, typename _Up = _Tp&&>
1097 template<typename _Tp>
1102 template<typename _Tp>
1103 auto declval() noexcept -> decltype(__declval<_Tp>(0));
1109 template<typename _Tp>
1110 struct __is_array_known_bounds
1114 template<
typename _Tp,
size_t _Size>
1115 struct __is_array_known_bounds<_Tp[_Size]>
1119 template<
typename _Tp>
1120 struct __is_array_unknown_bounds
1124 template<
typename _Tp>
1125 struct __is_array_unknown_bounds<_Tp[]>
1132#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
1134 template<
typename _Tp>
1136 :
public __bool_constant<__is_destructible(_Tp)>
1146 struct __do_is_destructible_impl
1148 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1155 template<
typename _Tp>
1156 struct __is_destructible_impl
1157 :
public __do_is_destructible_impl
1159 using type =
decltype(__test<_Tp>(0));
1162 template<
typename _Tp,
1163 bool = __or_<is_void<_Tp>,
1164 __is_array_unknown_bounds<_Tp>,
1167 struct __is_destructible_safe;
1169 template<
typename _Tp>
1170 struct __is_destructible_safe<_Tp, false, false>
1171 :
public __is_destructible_impl<typename
1172 remove_all_extents<_Tp>::type>::type
1175 template<
typename _Tp>
1176 struct __is_destructible_safe<_Tp, true, false>
1179 template<
typename _Tp>
1180 struct __is_destructible_safe<_Tp, false, true>
1185 template<
typename _Tp>
1187 :
public __is_destructible_safe<_Tp>::type
1189 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1190 "template argument must be a complete class or an unbounded array");
1194#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
1196 template<
typename _Tp>
1198 :
public __bool_constant<__is_nothrow_destructible(_Tp)>
1207 struct __do_is_nt_destructible_impl
1209 template<
typename _Tp>
1210 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1217 template<
typename _Tp>
1218 struct __is_nt_destructible_impl
1219 :
public __do_is_nt_destructible_impl
1221 using type =
decltype(__test<_Tp>(0));
1224 template<
typename _Tp,
1225 bool = __or_<is_void<_Tp>,
1226 __is_array_unknown_bounds<_Tp>,
1229 struct __is_nt_destructible_safe;
1231 template<
typename _Tp>
1232 struct __is_nt_destructible_safe<_Tp, false, false>
1233 :
public __is_nt_destructible_impl<typename
1234 remove_all_extents<_Tp>::type>::type
1237 template<
typename _Tp>
1238 struct __is_nt_destructible_safe<_Tp, true, false>
1241 template<
typename _Tp>
1242 struct __is_nt_destructible_safe<_Tp, false, true>
1247 template<
typename _Tp>
1249 :
public __is_nt_destructible_safe<_Tp>::type
1251 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1252 "template argument must be a complete class or an unbounded array");
1257 template<
typename _Tp,
typename... _Args>
1258 using __is_constructible_impl
1259 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1263 template<
typename _Tp,
typename... _Args>
1265 :
public __is_constructible_impl<_Tp, _Args...>
1267 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1268 "template argument must be a complete class or an unbounded array");
1272 template<
typename _Tp>
1274 :
public __is_constructible_impl<_Tp>
1276 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1277 "template argument must be a complete class or an unbounded array");
1281#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_lvalue_reference)
1282 template<
typename _Tp>
1283 using __add_lval_ref_t = __add_lvalue_reference(_Tp);
1285 template<
typename _Tp,
typename =
void>
1286 struct __add_lvalue_reference_helper
1287 {
using type = _Tp; };
1289 template<
typename _Tp>
1290 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1291 {
using type = _Tp&; };
1293 template<
typename _Tp>
1294 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1299 template<
typename _Tp>
1301 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1303 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1304 "template argument must be a complete class or an unbounded array");
1308#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_rvalue_reference)
1309 template<
typename _Tp>
1310 using __add_rval_ref_t = __add_rvalue_reference(_Tp);
1312 template<
typename _Tp,
typename =
void>
1313 struct __add_rvalue_reference_helper
1314 {
using type = _Tp; };
1316 template<
typename _Tp>
1317 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1318 {
using type = _Tp&&; };
1320 template<
typename _Tp>
1321 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1326 template<
typename _Tp>
1328 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1330 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1331 "template argument must be a complete class or an unbounded array");
1335 template<
typename _Tp,
typename... _Args>
1336 using __is_nothrow_constructible_impl
1337 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1341 template<
typename _Tp,
typename... _Args>
1343 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1345 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1346 "template argument must be a complete class or an unbounded array");
1350 template<
typename _Tp>
1352 :
public __is_nothrow_constructible_impl<_Tp>
1354 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1355 "template argument must be a complete class or an unbounded array");
1359 template<
typename _Tp>
1361 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1363 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1364 "template argument must be a complete class or an unbounded array");
1368 template<
typename _Tp>
1370 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1372 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1373 "template argument must be a complete class or an unbounded array");
1377 template<
typename _Tp,
typename _Up>
1378 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1382 template<
typename _Tp,
typename _Up>
1384 :
public __is_assignable_impl<_Tp, _Up>
1386 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1387 "template argument must be a complete class or an unbounded array");
1391 template<
typename _Tp>
1393 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1394 __add_lval_ref_t<const _Tp>>
1396 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1397 "template argument must be a complete class or an unbounded array");
1401 template<
typename _Tp>
1403 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1405 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1406 "template argument must be a complete class or an unbounded array");
1410 template<
typename _Tp,
typename _Up>
1411 using __is_nothrow_assignable_impl
1412 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1416 template<
typename _Tp,
typename _Up>
1418 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1420 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1421 "template argument must be a complete class or an unbounded array");
1425 template<
typename _Tp>
1427 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1428 __add_lval_ref_t<const _Tp>>
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_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1438 __add_rval_ref_t<_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,
typename... _Args>
1446 using __is_trivially_constructible_impl
1447 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1451 template<
typename _Tp,
typename... _Args>
1453 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1455 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1456 "template argument must be a complete class or an unbounded array");
1460 template<
typename _Tp>
1462 :
public __is_trivially_constructible_impl<_Tp>
1464 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1465 "template argument must be a complete class or an unbounded array");
1468#if __cpp_variable_templates && __cpp_concepts
1469 template<
typename _Tp>
1470 constexpr bool __is_implicitly_default_constructible_v
1471 =
requires (void(&__f)(_Tp)) { __f({}); };
1473 template<
typename _Tp>
1474 struct __is_implicitly_default_constructible
1475 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1478 struct __do_is_implicitly_default_constructible_impl
1480 template <
typename _Tp>
1481 static void __helper(
const _Tp&);
1483 template <
typename _Tp>
1485 decltype(__helper<const _Tp&>({}))* = 0);
1490 template<
typename _Tp>
1491 struct __is_implicitly_default_constructible_impl
1492 :
public __do_is_implicitly_default_constructible_impl
1497 template<
typename _Tp>
1498 struct __is_implicitly_default_constructible_safe
1499 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1502 template <
typename _Tp>
1503 struct __is_implicitly_default_constructible
1504 :
public __and_<__is_constructible_impl<_Tp>,
1505 __is_implicitly_default_constructible_safe<_Tp>>::type
1510 template<
typename _Tp>
1512 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1514 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1515 "template argument must be a complete class or an unbounded array");
1519 template<
typename _Tp>
1521 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1523 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1524 "template argument must be a complete class or an unbounded array");
1528 template<
typename _Tp,
typename _Up>
1529 using __is_trivially_assignable_impl
1530 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1534 template<
typename _Tp,
typename _Up>
1536 :
public __is_trivially_assignable_impl<_Tp, _Up>
1538 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1539 "template argument must be a complete class or an unbounded array");
1543 template<
typename _Tp>
1545 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1546 __add_lval_ref_t<const _Tp>>
1548 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1549 "template argument must be a complete class or an unbounded array");
1553 template<
typename _Tp>
1555 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1556 __add_rval_ref_t<_Tp>>
1558 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1559 "template argument must be a complete class or an unbounded array");
1562#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
1564 template<
typename _Tp>
1566 :
public __bool_constant<__is_trivially_destructible(_Tp)>
1570 template<
typename _Tp>
1572 :
public __and_<__is_destructible_safe<_Tp>,
1573 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1575 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1576 "template argument must be a complete class or an unbounded array");
1581 template<
typename _Tp>
1583 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1585 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1586 "template argument must be a complete class or an unbounded array");
1593 template<
typename _Tp>
1597 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1598 "template argument must be a complete class or an unbounded array");
1602#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
1603 && (!defined(__clang__) || __clang_major__ >= 20)
1604 template<
typename _Tp>
1612 template<
typename _Tp, std::
size_t _Size>
1613 struct rank<_Tp[_Size]>
1614 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1616 template<
typename _Tp>
1622 template<
typename,
unsigned _U
int = 0>
1626 template<
typename _Tp,
size_t _Size>
1627 struct extent<_Tp[_Size], 0>
1630 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1631 struct extent<_Tp[_Size], _Uint>
1632 :
public extent<_Tp, _Uint - 1>::type { };
1634 template<
typename _Tp>
1638 template<
typename _Tp,
unsigned _U
int>
1639 struct extent<_Tp[], _Uint>
1640 :
public extent<_Tp, _Uint - 1>::type { };
1646#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1647 template<
typename _Tp,
typename _Up>
1649 :
public __bool_constant<__is_same(_Tp, _Up)>
1652 template<
typename _Tp,
typename _Up>
1657 template<
typename _Tp>
1658 struct is_same<_Tp, _Tp>
1664 template<
typename _Base,
typename _Derived>
1666 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1669#ifdef __cpp_lib_is_virtual_base_of
1672 template<typename _Base, typename _Derived>
1673 struct is_virtual_base_of
1674 :
public bool_constant<__builtin_is_virtual_base_of(_Base, _Derived)>
1678#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1679 template<
typename _From,
typename _To>
1680 struct is_convertible
1681 :
public __bool_constant<__is_convertible(_From, _To)>
1684 template<
typename _From,
typename _To,
1687 struct __is_convertible_helper
1689 using type =
typename is_void<_To>::type;
1692#pragma GCC diagnostic push
1693#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1694 template<
typename _From,
typename _To>
1695 class __is_convertible_helper<_From, _To, false>
1697 template<
typename _To1>
1698 static void __test_aux(_To1)
noexcept;
1700 template<
typename _From1,
typename _To1,
1705 template<
typename,
typename>
1710 using type =
decltype(__test<_From, _To>(0));
1712#pragma GCC diagnostic pop
1715 template<
typename _From,
typename _To>
1716 struct is_convertible
1717 :
public __is_convertible_helper<_From, _To>::type
1722 template<
typename _ToElementType,
typename _FromElementType>
1723 using __is_array_convertible
1724 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1726#ifdef __cpp_lib_is_nothrow_convertible
1728#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1730 template<
typename _From,
typename _To>
1731 inline constexpr bool is_nothrow_convertible_v
1732 = __is_nothrow_convertible(_From, _To);
1735 template<
typename _From,
typename _To>
1736 struct is_nothrow_convertible
1737 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1740 template<
typename _From,
typename _To,
1743 struct __is_nt_convertible_helper
1747#pragma GCC diagnostic push
1748#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1749 template<
typename _From,
typename _To>
1750 class __is_nt_convertible_helper<_From, _To, false>
1752 template<
typename _To1>
1753 static void __test_aux(_To1)
noexcept;
1755 template<
typename _From1,
typename _To1>
1760 template<
typename,
typename>
1765 using type =
decltype(__test<_From, _To>(0));
1767#pragma GCC diagnostic pop
1770 template<
typename _From,
typename _To>
1771 struct is_nothrow_convertible
1772 :
public __is_nt_convertible_helper<_From, _To>::type
1776 template<
typename _From,
typename _To>
1777 inline constexpr bool is_nothrow_convertible_v
1778 = is_nothrow_convertible<_From, _To>::value;
1782#pragma GCC diagnostic push
1783#pragma GCC diagnostic ignored "-Wc++14-extensions"
1784 template<
typename _Tp,
typename... _Args>
1785 struct __is_nothrow_new_constructible_impl
1787 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1791 template<
typename _Tp,
typename... _Args>
1792 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1794 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1795#pragma GCC diagnostic pop
1800 template<
typename _Tp>
1802 {
using type = _Tp; };
1804 template<
typename _Tp>
1806 {
using type = _Tp; };
1809 template<
typename _Tp>
1811 {
using type = _Tp; };
1813 template<
typename _Tp>
1815 {
using type = _Tp; };
1818#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1819 template<
typename _Tp>
1821 {
using type = __remove_cv(_Tp); };
1823 template<
typename _Tp>
1825 {
using type = _Tp; };
1827 template<
typename _Tp>
1828 struct remove_cv<const _Tp>
1829 {
using type = _Tp; };
1831 template<
typename _Tp>
1833 {
using type = _Tp; };
1835 template<
typename _Tp>
1837 {
using type = _Tp; };
1841 template<
typename _Tp>
1843 {
using type = _Tp
const; };
1846 template<
typename _Tp>
1848 {
using type = _Tp
volatile; };
1851 template<
typename _Tp>
1853 {
using type = _Tp
const volatile; };
1855#ifdef __cpp_lib_transformation_trait_aliases
1857 template<typename _Tp>
1858 using remove_const_t =
typename remove_const<_Tp>::type;
1861 template<
typename _Tp>
1862 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1865 template<
typename _Tp>
1866 using remove_cv_t =
typename remove_cv<_Tp>::type;
1869 template<
typename _Tp>
1870 using add_const_t =
typename add_const<_Tp>::type;
1873 template<
typename _Tp>
1874 using add_volatile_t =
typename add_volatile<_Tp>::type;
1877 template<
typename _Tp>
1878 using add_cv_t =
typename add_cv<_Tp>::type;
1884#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1885 template<
typename _Tp>
1887 {
using type = __remove_reference(_Tp); };
1889 template<
typename _Tp>
1891 {
using type = _Tp; };
1893 template<
typename _Tp>
1894 struct remove_reference<_Tp&>
1895 {
using type = _Tp; };
1897 template<
typename _Tp>
1899 {
using type = _Tp; };
1903 template<
typename _Tp>
1905 {
using type = __add_lval_ref_t<_Tp>; };
1908 template<
typename _Tp>
1910 {
using type = __add_rval_ref_t<_Tp>; };
1912#if __cplusplus > 201103L
1914 template<
typename _Tp>
1918 template<
typename _Tp>
1922 template<
typename _Tp>
1931 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1932 struct __cv_selector;
1934 template<
typename _Unqualified>
1935 struct __cv_selector<_Unqualified, false, false>
1936 {
using __type = _Unqualified; };
1938 template<
typename _Unqualified>
1939 struct __cv_selector<_Unqualified, false, true>
1940 {
using __type =
volatile _Unqualified; };
1942 template<
typename _Unqualified>
1943 struct __cv_selector<_Unqualified, true, false>
1944 {
using __type =
const _Unqualified; };
1946 template<
typename _Unqualified>
1947 struct __cv_selector<_Unqualified, true, true>
1948 {
using __type =
const volatile _Unqualified; };
1950 template<
typename _Qualified,
typename _Unqualified,
1953 class __match_cv_qualifiers
1955 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1958 using __type =
typename __match::__type;
1962 template<
typename _Tp>
1963 struct __make_unsigned
1964 {
using __type = _Tp; };
1967 struct __make_unsigned<char>
1968 {
using __type =
unsigned char; };
1971 struct __make_unsigned<signed char>
1972 {
using __type =
unsigned char; };
1975 struct __make_unsigned<short>
1976 {
using __type =
unsigned short; };
1979 struct __make_unsigned<int>
1980 {
using __type =
unsigned int; };
1983 struct __make_unsigned<long>
1984 {
using __type =
unsigned long; };
1987 struct __make_unsigned<long long>
1988 {
using __type =
unsigned long long; };
1990#if defined(__GLIBCXX_TYPE_INT_N_0)
1993 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1994 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1996#if defined(__GLIBCXX_TYPE_INT_N_1)
1999 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
2000 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
2002#if defined(__GLIBCXX_TYPE_INT_N_2)
2005 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
2006 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
2008#if defined(__GLIBCXX_TYPE_INT_N_3)
2011 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
2012 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
2014#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
2017 struct __make_unsigned<__int128>
2018 {
using __type =
unsigned __int128; };
2022 template<
typename _Tp,
2024 bool _IsEnum = __is_enum(_Tp)>
2025 class __make_unsigned_selector;
2027 template<
typename _Tp>
2028 class __make_unsigned_selector<_Tp, true, false>
2030 using __unsigned_type
2031 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
2035 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2038 class __make_unsigned_selector_base
2041 template<
typename...>
struct _List { };
2043 template<
typename _Tp,
typename... _Up>
2044 struct _List<_Tp, _Up...> : _List<_Up...>
2045 {
static constexpr size_t __size =
sizeof(_Tp); };
2047 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
2050 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
2051 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
2052 {
using __type = _Uint; };
2054 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
2055 struct __select<_Sz, _List<_Uint, _UInts...>, false>
2056 : __select<_Sz, _List<_UInts...>>
2061 template<
typename _Tp>
2062 class __make_unsigned_selector<_Tp, false, true>
2063 : __make_unsigned_selector_base
2067 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
2068 unsigned long,
unsigned long long
2069#ifdef __SIZEOF_INT128__
2074 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
2078 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2086 struct __make_unsigned<wchar_t>
2089 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
2092#ifdef _GLIBCXX_USE_CHAR8_T
2094 struct __make_unsigned<char8_t>
2097 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
2102 struct __make_unsigned<char16_t>
2105 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
2109 struct __make_unsigned<char32_t>
2112 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
2120 template<
typename _Tp>
2122 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
2133 template<
typename _Tp>
2134 struct __make_signed
2135 {
using __type = _Tp; };
2138 struct __make_signed<char>
2139 {
using __type =
signed char; };
2142 struct __make_signed<unsigned char>
2143 {
using __type =
signed char; };
2146 struct __make_signed<unsigned short>
2147 {
using __type =
signed short; };
2150 struct __make_signed<unsigned int>
2151 {
using __type =
signed int; };
2154 struct __make_signed<unsigned long>
2155 {
using __type =
signed long; };
2158 struct __make_signed<unsigned long long>
2159 {
using __type =
signed long long; };
2161#if defined(__GLIBCXX_TYPE_INT_N_0)
2164 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
2165 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
2167#if defined(__GLIBCXX_TYPE_INT_N_1)
2170 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
2171 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
2173#if defined(__GLIBCXX_TYPE_INT_N_2)
2176 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
2177 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
2179#if defined(__GLIBCXX_TYPE_INT_N_3)
2182 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
2183 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
2185#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
2188 struct __make_signed<unsigned __int128>
2189 {
using __type = __int128; };
2193 template<
typename _Tp,
2195 bool _IsEnum = __is_enum(_Tp)>
2196 class __make_signed_selector;
2198 template<
typename _Tp>
2199 class __make_signed_selector<_Tp, true, false>
2202 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2206 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2210 template<
typename _Tp>
2211 class __make_signed_selector<_Tp, false, true>
2213 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2216 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2224 struct __make_signed<wchar_t>
2227 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2230#if defined(_GLIBCXX_USE_CHAR8_T)
2232 struct __make_signed<char8_t>
2235 =
typename __make_signed_selector<char8_t, false, true>::__type;
2240 struct __make_signed<char16_t>
2243 =
typename __make_signed_selector<char16_t, false, true>::__type;
2247 struct __make_signed<char32_t>
2250 =
typename __make_signed_selector<char32_t, false, true>::__type;
2258 template<
typename _Tp>
2260 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2266 template<>
struct make_signed<bool const volatile>;
2268#if __cplusplus > 201103L
2270 template<
typename _Tp>
2274 template<
typename _Tp>
2281#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent)
2282 template<
typename _Tp>
2284 {
using type = __remove_extent(_Tp); };
2286 template<
typename _Tp>
2288 {
using type = _Tp; };
2290 template<
typename _Tp, std::
size_t _Size>
2291 struct remove_extent<_Tp[_Size]>
2292 {
using type = _Tp; };
2294 template<
typename _Tp>
2296 {
using type = _Tp; };
2300#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_all_extents)
2301 template<
typename _Tp>
2303 {
using type = __remove_all_extents(_Tp); };
2305 template<
typename _Tp>
2307 {
using type = _Tp; };
2309 template<
typename _Tp, std::
size_t _Size>
2310 struct remove_all_extents<_Tp[_Size]>
2311 {
using type =
typename remove_all_extents<_Tp>::type; };
2313 template<
typename _Tp>
2315 {
using type =
typename remove_all_extents<_Tp>::type; };
2318#if __cplusplus > 201103L
2320 template<
typename _Tp>
2324 template<
typename _Tp>
2331#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2332 template<
typename _Tp>
2334 {
using type = __remove_pointer(_Tp); };
2336 template<
typename _Tp,
typename>
2337 struct __remove_pointer_helper
2338 {
using type = _Tp; };
2340 template<
typename _Tp,
typename _Up>
2341 struct __remove_pointer_helper<_Tp, _Up*>
2342 {
using type = _Up; };
2344 template<
typename _Tp>
2346 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2351#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_pointer)
2352 template<
typename _Tp>
2354 {
using type = __add_pointer(_Tp); };
2356 template<
typename _Tp,
typename =
void>
2357 struct __add_pointer_helper
2358 {
using type = _Tp; };
2360 template<
typename _Tp>
2361 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2362 {
using type = _Tp*; };
2364 template<
typename _Tp>
2366 :
public __add_pointer_helper<_Tp>
2369 template<
typename _Tp>
2371 {
using type = _Tp*; };
2373 template<
typename _Tp>
2375 {
using type = _Tp*; };
2378#if __cplusplus > 201103L
2380 template<
typename _Tp>
2384 template<
typename _Tp>
2391 struct __attribute__((__aligned__)) __aligned_storage_max_align_t
2395 __aligned_storage_default_alignment([[__maybe_unused__]]
size_t __len)
2397#if _GLIBCXX_INLINE_VERSION
2399 = integral_constant<size_t,
alignof(__aligned_storage_max_align_t)>;
2401 return __len > (_Max_align::value / 2)
2403#
if _GLIBCXX_USE_BUILTIN_TRAIT(__builtin_clzg)
2404 : 1 << (__SIZE_WIDTH__ - __builtin_clzg(__len - 1u));
2406 : 1 << (__LLONG_WIDTH__ - __builtin_clzll(__len - 1ull));
2411 return alignof(__aligned_storage_max_align_t);
2447 template<
size_t _Len,
2448 size_t _Align = __aligned_storage_default_alignment(_Len)>
2450 _GLIBCXX23_DEPRECATED
2455 alignas(_Align)
unsigned char __data[_Len];
2459 template <
typename... _Types>
2460 struct __strictest_alignment
2462 static const size_t _S_alignment = 0;
2463 static const size_t _S_size = 0;
2466 template <
typename _Tp,
typename... _Types>
2467 struct __strictest_alignment<_Tp, _Types...>
2469 static const size_t _S_alignment =
2470 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2471 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2472 static const size_t _S_size =
2473 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2474 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2477#pragma GCC diagnostic push
2478#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2492 template <
size_t _Len,
typename... _Types>
2494 _GLIBCXX23_DEPRECATED
2498 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2500 using __strictest = __strictest_alignment<_Types...>;
2501 static const size_t _S_len = _Len > __strictest::_S_size
2502 ? _Len : __strictest::_S_size;
2507 using type =
typename aligned_storage<_S_len, alignment_value>::type;
2510 template <
size_t _Len,
typename... _Types>
2511 const size_t aligned_union<_Len, _Types...>::alignment_value;
2512#pragma GCC diagnostic pop
2516#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
2517 template<
typename _Tp>
2519 {
using type = __decay(_Tp); };
2523 template<
typename _Up>
2524 struct __decay_selector
2525 : __conditional_t<is_const<const _Up>::value,
2530 template<
typename _Up,
size_t _Nm>
2531 struct __decay_selector<_Up[_Nm]>
2532 {
using type = _Up*; };
2534 template<
typename _Up>
2535 struct __decay_selector<_Up[]>
2536 {
using type = _Up*; };
2541 template<
typename _Tp>
2543 {
using type =
typename __decay_selector<_Tp>::type; };
2545 template<
typename _Tp>
2547 {
using type =
typename __decay_selector<_Tp>::type; };
2549 template<
typename _Tp>
2551 {
using type =
typename __decay_selector<_Tp>::type; };
2557 template<
typename _Tp>
2558 struct __strip_reference_wrapper
2563 template<
typename _Tp>
2566 using __type = _Tp&;
2570 template<
typename _Tp>
2571 using __decay_t =
typename decay<_Tp>::type;
2573 template<
typename _Tp>
2574 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2580 template<
typename... _Cond>
2581 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2584 template<
typename _Tp>
2585 using __remove_cvref_t
2591 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2593 {
using type = _Iftrue; };
2596 template<
typename _Iftrue,
typename _Iffalse>
2598 {
using type = _Iffalse; };
2601 template<
typename... _Tp>
2613 template<
typename _Tp>
2614 struct __success_type
2615 {
using type = _Tp; };
2617 struct __failure_type
2620 struct __do_common_type_impl
2622 template<
typename _Tp,
typename _Up>
2628 template<
typename _Tp,
typename _Up>
2629 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2632#if __cplusplus > 201703L
2635 template<
typename _Tp,
typename _Up>
2636 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2640 template<
typename,
typename>
2641 static __failure_type
2644 template<
typename _Tp,
typename _Up>
2645 static decltype(_S_test_2<_Tp, _Up>(0))
2655 template<
typename _Tp0>
2661 template<
typename _Tp1,
typename _Tp2,
2662 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2663 struct __common_type_impl
2667 using type = common_type<_Dp1, _Dp2>;
2670 template<
typename _Tp1,
typename _Tp2>
2671 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2672 :
private __do_common_type_impl
2676 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2680 template<
typename _Tp1,
typename _Tp2>
2682 :
public __common_type_impl<_Tp1, _Tp2>::type
2685 template<
typename...>
2686 struct __common_type_pack
2689 template<
typename,
typename,
typename =
void>
2690 struct __common_type_fold;
2693 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2695 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2696 __common_type_pack<_Rp...>>
2702 template<
typename _CTp,
typename... _Rp>
2703 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2704 __void_t<typename _CTp::type>>
2709 template<
typename _CTp,
typename _Rp>
2710 struct __common_type_fold<_CTp, _Rp, void>
2713 template<
typename _Tp,
bool = __is_enum(_Tp)>
2714 struct __underlying_type_impl
2716 using type = __underlying_type(_Tp);
2719 template<
typename _Tp>
2720 struct __underlying_type_impl<_Tp, false>
2725 template<
typename _Tp>
2727 :
public __underlying_type_impl<_Tp>
2731 template<
typename _Tp>
2732 struct __declval_protector
2734 static const bool __stop =
false;
2742 template<
typename _Tp>
2743 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2745 static_assert(__declval_protector<_Tp>::__stop,
2746 "declval() must not be used!");
2747 return __declval<_Tp>(0);
2751 template<
typename _Signature>
2757 struct __invoke_memfun_ref { };
2758 struct __invoke_memfun_deref { };
2759 struct __invoke_memobj_ref { };
2760 struct __invoke_memobj_deref { };
2761 struct __invoke_other { };
2764 template<
typename _Tp,
typename _Tag>
2765 struct __result_of_success : __success_type<_Tp>
2766 {
using __invoke_type = _Tag; };
2769 struct __result_of_memfun_ref_impl
2771 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2772 static __result_of_success<
decltype(
2774 ), __invoke_memfun_ref> _S_test(
int);
2776 template<
typename...>
2777 static __failure_type _S_test(...);
2780 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2781 struct __result_of_memfun_ref
2782 :
private __result_of_memfun_ref_impl
2784 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2788 struct __result_of_memfun_deref_impl
2790 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2791 static __result_of_success<
decltype(
2793 ), __invoke_memfun_deref> _S_test(
int);
2795 template<
typename...>
2796 static __failure_type _S_test(...);
2799 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2800 struct __result_of_memfun_deref
2801 :
private __result_of_memfun_deref_impl
2803 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2807 struct __result_of_memobj_ref_impl
2809 template<
typename _Fp,
typename _Tp1>
2810 static __result_of_success<
decltype(
2812 ), __invoke_memobj_ref> _S_test(
int);
2814 template<
typename,
typename>
2815 static __failure_type _S_test(...);
2818 template<
typename _MemPtr,
typename _Arg>
2819 struct __result_of_memobj_ref
2820 :
private __result_of_memobj_ref_impl
2822 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2826 struct __result_of_memobj_deref_impl
2828 template<
typename _Fp,
typename _Tp1>
2829 static __result_of_success<
decltype(
2831 ), __invoke_memobj_deref> _S_test(
int);
2833 template<
typename,
typename>
2834 static __failure_type _S_test(...);
2837 template<
typename _MemPtr,
typename _Arg>
2838 struct __result_of_memobj_deref
2839 :
private __result_of_memobj_deref_impl
2841 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2844 template<
typename _MemPtr,
typename _Arg>
2845 struct __result_of_memobj;
2847 template<
typename _Res,
typename _Class,
typename _Arg>
2848 struct __result_of_memobj<_Res _Class::*, _Arg>
2850 using _Argval = __remove_cvref_t<_Arg>;
2851 using _MemPtr = _Res _Class::*;
2852 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2853 is_base_of<_Class, _Argval>>::value,
2854 __result_of_memobj_ref<_MemPtr, _Arg>,
2855 __result_of_memobj_deref<_MemPtr, _Arg>
2859 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2860 struct __result_of_memfun;
2862 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2863 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2865 using _Argval =
typename remove_reference<_Arg>::type;
2866 using _MemPtr = _Res _Class::*;
2867 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2868 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2869 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2878 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2884 template<
typename _Tp,
typename _Up>
2890 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2891 struct __result_of_impl
2893 using type = __failure_type;
2896 template<
typename _MemPtr,
typename _Arg>
2897 struct __result_of_impl<true, false, _MemPtr, _Arg>
2898 :
public __result_of_memobj<__decay_t<_MemPtr>,
2899 typename __inv_unwrap<_Arg>::type>
2902 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2903 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2904 :
public __result_of_memfun<__decay_t<_MemPtr>,
2905 typename __inv_unwrap<_Arg>::type, _Args...>
2909 struct __result_of_other_impl
2911 template<
typename _Fn,
typename... _Args>
2912 static __result_of_success<
decltype(
2914 ), __invoke_other> _S_test(
int);
2916 template<
typename...>
2917 static __failure_type _S_test(...);
2920 template<
typename _Functor,
typename... _ArgTypes>
2921 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2922 :
private __result_of_other_impl
2924 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2928 template<
typename _Functor,
typename... _ArgTypes>
2929 struct __invoke_result
2930 :
public __result_of_impl<
2931 is_member_object_pointer<
2932 typename remove_reference<_Functor>::type
2934 is_member_function_pointer<
2935 typename remove_reference<_Functor>::type
2937 _Functor, _ArgTypes...
2942 template<
typename _Fn,
typename... _Args>
2943 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2946 template<
typename _Functor,
typename... _ArgTypes>
2947 struct result_of<_Functor(_ArgTypes...)>
2948 :
public __invoke_result<_Functor, _ArgTypes...>
2949 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2951#if __cplusplus >= 201402L
2952#pragma GCC diagnostic push
2953#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2955 template<
size_t _Len,
2956 size_t _Align = __aligned_storage_default_alignment(_Len)>
2957 using aligned_storage_t _GLIBCXX23_DEPRECATED =
typename aligned_storage<_Len, _Align>::type;
2959 template <
size_t _Len,
typename... _Types>
2960 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2961#pragma GCC diagnostic pop
2964 template<
typename _Tp>
2965 using decay_t =
typename decay<_Tp>::type;
2968 template<
bool _Cond,
typename _Tp =
void>
2972 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2973 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2976 template<
typename... _Tp>
2980 template<
typename _Tp>
2984 template<
typename _Tp>
2988#ifdef __cpp_lib_void_t
2990 template<typename...> using void_t = void;
3000 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
3001 struct __detected_or
3008 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
3009 requires requires {
typename _Op<_Args...>; }
3010 struct __detected_or<_Def, _Op, _Args...>
3012 using type = _Op<_Args...>;
3017 template<
typename _Default,
typename _AlwaysVoid,
3018 template<
typename...>
class _Op,
typename... _Args>
3021 using type = _Default;
3026 template<
typename _Default,
template<
typename...>
class _Op,
3028 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
3030 using type = _Op<_Args...>;
3034 template<
typename _Default,
template<
typename...>
class _Op,
3036 using __detected_or = __detector<_Default, void, _Op, _Args...>;
3040 template<
typename _Default,
template<
typename...>
class _Op,
3042 using __detected_or_t
3043 =
typename __detected_or<_Default, _Op, _Args...>::type;
3049#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
3050 template<typename _Tp, typename = __void_t<>> \
3051 struct __has_##_NTYPE \
3054 template<typename _Tp> \
3055 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
3059 template <
typename _Tp>
3060 struct __is_swappable;
3062 template <
typename _Tp>
3063 struct __is_nothrow_swappable;
3070 template<
typename _Tp>
3071 struct __is_tuple_like
3072 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
3076 template<
typename _Tp>
3077 _GLIBCXX20_CONSTEXPR
3079 _Require<__not_<__is_tuple_like<_Tp>>,
3083 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
3086 template<
typename _Tp,
size_t _Nm>
3087 _GLIBCXX20_CONSTEXPR
3089 __enable_if_t<__is_swappable<_Tp>::value>
3090 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
3091 noexcept(__is_nothrow_swappable<_Tp>::value);
3094 namespace __swappable_details {
3097 struct __do_is_swappable_impl
3099 template<
typename _Tp,
typename
3101 static true_type __test(
int);
3107 struct __do_is_nothrow_swappable_impl
3109 template<
typename _Tp>
3110 static __bool_constant<
3120 template<
typename _Tp>
3121 struct __is_swappable_impl
3122 :
public __swappable_details::__do_is_swappable_impl
3124 using type =
decltype(__test<_Tp>(0));
3127 template<
typename _Tp>
3128 struct __is_nothrow_swappable_impl
3129 :
public __swappable_details::__do_is_nothrow_swappable_impl
3131 using type =
decltype(__test<_Tp>(0));
3134 template<
typename _Tp>
3135 struct __is_swappable
3136 :
public __is_swappable_impl<_Tp>::type
3139 template<
typename _Tp>
3140 struct __is_nothrow_swappable
3141 :
public __is_nothrow_swappable_impl<_Tp>::type
3145#ifdef __cpp_lib_is_swappable
3149 template<
typename _Tp>
3151 :
public __is_swappable_impl<_Tp>::type
3153 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3154 "template argument must be a complete class or an unbounded array");
3158 template<
typename _Tp>
3159 struct is_nothrow_swappable
3160 :
public __is_nothrow_swappable_impl<_Tp>::type
3162 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3163 "template argument must be a complete class or an unbounded array");
3166#if __cplusplus >= 201402L
3168 template<
typename _Tp>
3169 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
3170 is_swappable<_Tp>::value;
3173 template<
typename _Tp>
3174 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
3175 is_nothrow_swappable<_Tp>::value;
3179 namespace __swappable_with_details {
3182 struct __do_is_swappable_with_impl
3184 template<
typename _Tp,
typename _Up,
typename
3190 template<
typename,
typename>
3194 struct __do_is_nothrow_swappable_with_impl
3196 template<
typename _Tp,
typename _Up>
3197 static __bool_constant<
3203 template<
typename,
typename>
3209 template<
typename _Tp,
typename _Up>
3210 struct __is_swappable_with_impl
3211 :
public __swappable_with_details::__do_is_swappable_with_impl
3213 using type =
decltype(__test<_Tp, _Up>(0));
3217 template<
typename _Tp>
3218 struct __is_swappable_with_impl<_Tp&, _Tp&>
3219 :
public __swappable_details::__do_is_swappable_impl
3221 using type =
decltype(__test<_Tp&>(0));
3224 template<
typename _Tp,
typename _Up>
3225 struct __is_nothrow_swappable_with_impl
3226 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
3228 using type =
decltype(__test<_Tp, _Up>(0));
3232 template<
typename _Tp>
3233 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
3234 :
public __swappable_details::__do_is_nothrow_swappable_impl
3236 using type =
decltype(__test<_Tp&>(0));
3241 template<
typename _Tp,
typename _Up>
3242 struct is_swappable_with
3243 :
public __is_swappable_with_impl<_Tp, _Up>::type
3245 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3246 "first template argument must be a complete class or an unbounded array");
3247 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3248 "second template argument must be a complete class or an unbounded array");
3252 template<
typename _Tp,
typename _Up>
3253 struct is_nothrow_swappable_with
3254 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
3256 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3257 "first template argument must be a complete class or an unbounded array");
3258 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3259 "second template argument must be a complete class or an unbounded array");
3262#if __cplusplus >= 201402L
3264 template<
typename _Tp,
typename _Up>
3265 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3266 is_swappable_with<_Tp, _Up>::value;
3269 template<
typename _Tp,
typename _Up>
3270 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3271 is_nothrow_swappable_with<_Tp, _Up>::value;
3281 template<
typename _Result,
typename _Ret,
3283 struct __is_invocable_impl
3290 template<
typename _Result,
typename _Ret>
3291 struct __is_invocable_impl<_Result, _Ret,
3293 __void_t<typename _Result::type>>
3299#pragma GCC diagnostic push
3300#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3302 template<
typename _Result,
typename _Ret>
3303 struct __is_invocable_impl<_Result, _Ret,
3305 __void_t<typename _Result::type>>
3309 using _Res_t =
typename _Result::type;
3313 static _Res_t _S_get() noexcept;
3316 template<typename _Tp>
3317 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3320 template<typename _Tp,
3321 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3322 typename = decltype(_S_conv<_Tp>(_S_get())),
3323#if __has_builtin(__reference_converts_from_temporary)
3324 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3326 bool _Dangle =
false
3329 static __bool_constant<_Nothrow && !_Dangle>
3332 template<
typename _Tp,
bool = false>
3338 using type =
decltype(_S_test<_Ret,
true>(1));
3341 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3343#pragma GCC diagnostic pop
3345 template<
typename _Fn,
typename... _ArgTypes>
3346 struct __is_invocable
3347#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3348 : __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3350 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3354 template<
typename _Fn,
typename _Tp,
typename... _Args>
3355 constexpr bool __call_is_nt(__invoke_memfun_ref)
3357 using _Up =
typename __inv_unwrap<_Tp>::type;
3362 template<
typename _Fn,
typename _Tp,
typename... _Args>
3363 constexpr bool __call_is_nt(__invoke_memfun_deref)
3369 template<
typename _Fn,
typename _Tp>
3370 constexpr bool __call_is_nt(__invoke_memobj_ref)
3372 using _Up =
typename __inv_unwrap<_Tp>::type;
3376 template<
typename _Fn,
typename _Tp>
3377 constexpr bool __call_is_nt(__invoke_memobj_deref)
3382 template<
typename _Fn,
typename... _Args>
3383 constexpr bool __call_is_nt(__invoke_other)
3388 template<
typename _Result,
typename _Fn,
typename... _Args>
3389 struct __call_is_nothrow
3391 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3395 template<
typename _Fn,
typename... _Args>
3396 using __call_is_nothrow_
3397 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3400 template<
typename _Fn,
typename... _Args>
3401 struct __is_nothrow_invocable
3402#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3403 : __bool_constant<__is_nothrow_invocable(_Fn, _Args...)>
3405 : __and_<__is_invocable<_Fn, _Args...>,
3406 __call_is_nothrow_<_Fn, _Args...>>::type
3410#pragma GCC diagnostic push
3411#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3412 struct __nonesuchbase {};
3413 struct __nonesuch :
private __nonesuchbase {
3414 ~__nonesuch() =
delete;
3415 __nonesuch(__nonesuch
const&) =
delete;
3416 void operator=(__nonesuch
const&) =
delete;
3418#pragma GCC diagnostic pop
3421#ifdef __cpp_lib_is_invocable
3423 template<typename _Functor, typename... _ArgTypes>
3424 struct invoke_result
3425 :
public __invoke_result<_Functor, _ArgTypes...>
3427 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3428 "_Functor must be a complete class or an unbounded array");
3429 static_assert((std::__is_complete_or_unbounded(
3430 __type_identity<_ArgTypes>{}) && ...),
3431 "each argument type must be a complete class or an unbounded array");
3435 template<
typename _Fn,
typename... _Args>
3436 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3439 template<
typename _Fn,
typename... _ArgTypes>
3441#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3442 :
public __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3444 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3447 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3448 "_Fn must be a complete class or an unbounded array");
3449 static_assert((std::__is_complete_or_unbounded(
3450 __type_identity<_ArgTypes>{}) && ...),
3451 "each argument type must be a complete class or an unbounded array");
3455 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3456 struct is_invocable_r
3457 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3459 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3460 "_Fn must be a complete class or an unbounded array");
3461 static_assert((std::__is_complete_or_unbounded(
3462 __type_identity<_ArgTypes>{}) && ...),
3463 "each argument type must be a complete class or an unbounded array");
3464 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3465 "_Ret must be a complete class or an unbounded array");
3469 template<
typename _Fn,
typename... _ArgTypes>
3470 struct is_nothrow_invocable
3471#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3472 :
public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)>
3474 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3475 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3478 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3479 "_Fn must be a complete class or an unbounded array");
3480 static_assert((std::__is_complete_or_unbounded(
3481 __type_identity<_ArgTypes>{}) && ...),
3482 "each argument type must be a complete class or an unbounded array");
3489 template<
typename _Result,
typename _Ret>
3490 using __is_nt_invocable_impl
3491 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3495 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3496 struct is_nothrow_invocable_r
3497 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3498 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3500 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3501 "_Fn must be a complete class or an unbounded array");
3502 static_assert((std::__is_complete_or_unbounded(
3503 __type_identity<_ArgTypes>{}) && ...),
3504 "each argument type must be a complete class or an unbounded array");
3505 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3506 "_Ret must be a complete class or an unbounded array");
3510#if __cpp_lib_type_trait_variable_templates
3525template <
typename _Tp>
3527template <
typename _Tp>
3528 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3529template <
typename _Tp>
3531template <
typename _Tp>
3534#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3535template <
typename _Tp>
3536 inline constexpr bool is_array_v = __is_array(_Tp);
3538template <
typename _Tp>
3539 inline constexpr bool is_array_v =
false;
3540template <
typename _Tp>
3541 inline constexpr bool is_array_v<_Tp[]> =
true;
3542template <
typename _Tp,
size_t _Num>
3543 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3546#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
3547template <
typename _Tp>
3548 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
3550template <
typename _Tp>
3551 inline constexpr bool is_pointer_v =
false;
3552template <
typename _Tp>
3553 inline constexpr bool is_pointer_v<_Tp*> =
true;
3554template <
typename _Tp>
3555 inline constexpr bool is_pointer_v<_Tp* const> =
true;
3556template <
typename _Tp>
3557 inline constexpr bool is_pointer_v<_Tp* volatile> =
true;
3558template <
typename _Tp>
3559 inline constexpr bool is_pointer_v<_Tp* const volatile> =
true;
3562template <
typename _Tp>
3563 inline constexpr bool is_lvalue_reference_v =
false;
3564template <
typename _Tp>
3565 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3566template <
typename _Tp>
3567 inline constexpr bool is_rvalue_reference_v =
false;
3568template <
typename _Tp>
3569 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3571#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3572template <
typename _Tp>
3573 inline constexpr bool is_member_object_pointer_v =
3574 __is_member_object_pointer(_Tp);
3576template <
typename _Tp>
3577 inline constexpr bool is_member_object_pointer_v =
3581#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3582template <
typename _Tp>
3583 inline constexpr bool is_member_function_pointer_v =
3584 __is_member_function_pointer(_Tp);
3586template <
typename _Tp>
3587 inline constexpr bool is_member_function_pointer_v =
3591#if __cpp_impl_reflection >= 202506L
3592template <
typename _Tp>
3593 inline constexpr bool is_reflection_v =
false;
3595 inline constexpr bool is_reflection_v<
decltype(^^int)> =
true;
3597 inline constexpr bool is_reflection_v<
const decltype(^^int)> =
true;
3599 inline constexpr bool is_reflection_v<
volatile decltype(^^int)> =
true;
3601 inline constexpr bool is_reflection_v<
const volatile decltype(^^int)> =
true;
3604template <
typename _Tp>
3605 inline constexpr bool is_enum_v = __is_enum(_Tp);
3606template <
typename _Tp>
3607 inline constexpr bool is_union_v = __is_union(_Tp);
3608template <
typename _Tp>
3609 inline constexpr bool is_class_v = __is_class(_Tp);
3612#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3613template <
typename _Tp>
3614 inline constexpr bool is_reference_v = __is_reference(_Tp);
3616template <
typename _Tp>
3617 inline constexpr bool is_reference_v =
false;
3618template <
typename _Tp>
3619 inline constexpr bool is_reference_v<_Tp&> =
true;
3620template <
typename _Tp>
3621 inline constexpr bool is_reference_v<_Tp&&> =
true;
3624template <
typename _Tp>
3626template <
typename _Tp>
3629#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3630template <
typename _Tp>
3631 inline constexpr bool is_object_v = __is_object(_Tp);
3633template <
typename _Tp>
3637template <
typename _Tp>
3639template <
typename _Tp>
3640 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3642#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3643template <
typename _Tp>
3644 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3646template <
typename _Tp>
3650#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
3651template <
typename _Tp>
3652 inline constexpr bool is_const_v = __is_const(_Tp);
3654template <
typename _Tp>
3655 inline constexpr bool is_const_v =
false;
3656template <
typename _Tp>
3657 inline constexpr bool is_const_v<const _Tp> =
true;
3660#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3661template <
typename _Tp>
3662 inline constexpr bool is_function_v = __is_function(_Tp);
3664template <
typename _Tp>
3665 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3666template <
typename _Tp>
3667 inline constexpr bool is_function_v<_Tp&> =
false;
3668template <
typename _Tp>
3669 inline constexpr bool is_function_v<_Tp&&> =
false;
3672#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
3673template <
typename _Tp>
3674 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
3676template <
typename _Tp>
3677 inline constexpr bool is_volatile_v =
false;
3678template <
typename _Tp>
3679 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3682template <
typename _Tp>
3683 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible_v && is_trivially_copyable_v")
3684 inline constexpr
bool is_trivial_v = __is_trivial(_Tp);
3685template <typename _Tp>
3686 inline constexpr
bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3687template <typename _Tp>
3688 inline constexpr
bool is_standard_layout_v = __is_standard_layout(_Tp);
3689template <typename _Tp>
3690 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3691 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3692template <typename _Tp>
3693 _GLIBCXX17_DEPRECATED
3694 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3695template <typename _Tp>
3696 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3697template <typename _Tp>
3698 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3699template <typename _Tp>
3700 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3701template <typename _Tp>
3702 inline constexpr
bool is_final_v = __is_final(_Tp);
3704template <typename _Tp>
3705 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3706template <typename _Tp>
3707 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3709template <typename _Tp, typename... _Args>
3710 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3711template <typename _Tp>
3712 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3713template <typename _Tp>
3714 inline constexpr
bool is_copy_constructible_v
3715 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3716template <typename _Tp>
3717 inline constexpr
bool is_move_constructible_v
3718 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3720template <typename _Tp, typename _Up>
3721 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3722template <typename _Tp>
3723 inline constexpr
bool is_copy_assignable_v
3724 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3725template <typename _Tp>
3726 inline constexpr
bool is_move_assignable_v
3727 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3729#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
3730template <
typename _Tp>
3731 inline constexpr bool is_destructible_v = __is_destructible(_Tp);
3733template <
typename _Tp>
3737template <
typename _Tp,
typename... _Args>
3738 inline constexpr bool is_trivially_constructible_v
3739 = __is_trivially_constructible(_Tp, _Args...);
3740template <
typename _Tp>
3741 inline constexpr bool is_trivially_default_constructible_v
3742 = __is_trivially_constructible(_Tp);
3743template <
typename _Tp>
3744 inline constexpr bool is_trivially_copy_constructible_v
3745 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3746template <
typename _Tp>
3747 inline constexpr bool is_trivially_move_constructible_v
3748 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3750template <
typename _Tp,
typename _Up>
3751 inline constexpr bool is_trivially_assignable_v
3752 = __is_trivially_assignable(_Tp, _Up);
3753template <
typename _Tp>
3754 inline constexpr bool is_trivially_copy_assignable_v
3755 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3756 __add_lval_ref_t<const _Tp>);
3757template <
typename _Tp>
3758 inline constexpr bool is_trivially_move_assignable_v
3759 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3760 __add_rval_ref_t<_Tp>);
3762#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
3763template <
typename _Tp>
3764 inline constexpr bool is_trivially_destructible_v
3765 = __is_trivially_destructible(_Tp);
3767template <
typename _Tp>
3768 inline constexpr bool is_trivially_destructible_v =
false;
3770template <
typename _Tp>
3771 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3772 inline constexpr bool is_trivially_destructible_v<_Tp>
3773 = __has_trivial_destructor(_Tp);
3774template <
typename _Tp>
3775 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3776template <
typename _Tp>
3777 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3778template <
typename _Tp,
size_t _Nm>
3779 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3780 = is_trivially_destructible_v<_Tp>;
3782template <
typename _Tp>
3783 inline constexpr bool is_trivially_destructible_v =
3787template <
typename _Tp,
typename... _Args>
3788 inline constexpr bool is_nothrow_constructible_v
3789 = __is_nothrow_constructible(_Tp, _Args...);
3790template <
typename _Tp>
3791 inline constexpr bool is_nothrow_default_constructible_v
3792 = __is_nothrow_constructible(_Tp);
3793template <
typename _Tp>
3794 inline constexpr bool is_nothrow_copy_constructible_v
3795 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3796template <
typename _Tp>
3797 inline constexpr bool is_nothrow_move_constructible_v
3798 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3800template <
typename _Tp,
typename _Up>
3801 inline constexpr bool is_nothrow_assignable_v
3802 = __is_nothrow_assignable(_Tp, _Up);
3803template <
typename _Tp>
3804 inline constexpr bool is_nothrow_copy_assignable_v
3805 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3806 __add_lval_ref_t<const _Tp>);
3807template <
typename _Tp>
3808 inline constexpr bool is_nothrow_move_assignable_v
3809 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3811#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
3812template <
typename _Tp>
3813 inline constexpr bool is_nothrow_destructible_v
3814 = __is_nothrow_destructible(_Tp);
3816template <
typename _Tp>
3817 inline constexpr bool is_nothrow_destructible_v =
3821template <
typename _Tp>
3822 inline constexpr bool has_virtual_destructor_v
3823 = __has_virtual_destructor(_Tp);
3825template <
typename _Tp>
3826 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3828#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
3829 && (!defined(__clang__) || __clang_major__ >= 20)
3830template <
typename _Tp>
3831 inline constexpr size_t rank_v = __array_rank(_Tp);
3833template <
typename _Tp>
3834 inline constexpr size_t rank_v = 0;
3835template <
typename _Tp,
size_t _Size>
3836 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3837template <
typename _Tp>
3838 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3841template <
typename _Tp,
unsigned _Idx = 0>
3842 inline constexpr size_t extent_v = 0;
3843template <
typename _Tp,
size_t _Size>
3844 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3845template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3846 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3847template <
typename _Tp>
3848 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3849template <
typename _Tp,
unsigned _Idx>
3850 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3852#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3853template <
typename _Tp,
typename _Up>
3854 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3856template <
typename _Tp,
typename _Up>
3857 inline constexpr bool is_same_v =
false;
3858template <
typename _Tp>
3859 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3861template <
typename _Base,
typename _Derived>
3862 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3863#ifdef __cpp_lib_is_virtual_base_of
3864template <
typename _Base,
typename _Derived>
3865 inline constexpr bool is_virtual_base_of_v = __builtin_is_virtual_base_of(_Base, _Derived);
3867#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3868template <
typename _From,
typename _To>
3869 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3871template <
typename _From,
typename _To>
3872 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3874template<
typename _Fn,
typename... _Args>
3875 inline constexpr bool is_invocable_v
3876#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3877 = __is_invocable(_Fn, _Args...);
3879 = is_invocable<_Fn, _Args...>::value;
3881template<
typename _Fn,
typename... _Args>
3882 inline constexpr bool is_nothrow_invocable_v
3883#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3884 = __is_nothrow_invocable(_Fn, _Args...);
3886 = is_nothrow_invocable<_Fn, _Args...>::value;
3888template<
typename _Ret,
typename _Fn,
typename... _Args>
3889 inline constexpr bool is_invocable_r_v
3890 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3891template<
typename _Ret,
typename _Fn,
typename... _Args>
3892 inline constexpr bool is_nothrow_invocable_r_v
3893 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3897#ifdef __cpp_lib_has_unique_object_representations
3900 template<typename _Tp>
3901 struct has_unique_object_representations
3902 : bool_constant<__has_unique_object_representations(
3903 remove_cv_t<remove_all_extents_t<_Tp>>
3906 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3907 "template argument must be a complete class or an unbounded array");
3910# if __cpp_lib_type_trait_variable_templates
3912 template<typename _Tp>
3913 inline constexpr bool has_unique_object_representations_v
3914 = has_unique_object_representations<_Tp>::value;
3918#ifdef __cpp_lib_is_aggregate
3921 template<typename _Tp>
3923 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3926# if __cpp_lib_type_trait_variable_templates
3931 template<
typename _Tp>
3932 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3936#if __cpp_lib_is_structural >= 202603L
3939 template<typename _Tp>
3940 struct is_structural
3941 : bool_constant<__builtin_is_structural(_Tp)>
3948 template<
typename _Tp>
3949 inline constexpr bool is_structural_v
3950 = __builtin_is_structural(_Tp);
3957#ifdef __cpp_lib_remove_cvref
3958# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3959 template<
typename _Tp>
3961 {
using type = __remove_cvref(_Tp); };
3963 template<
typename _Tp>
3965 {
using type =
typename remove_cv<_Tp>::type; };
3967 template<
typename _Tp>
3968 struct remove_cvref<_Tp&>
3969 {
using type =
typename remove_cv<_Tp>::type; };
3971 template<
typename _Tp>
3972 struct remove_cvref<_Tp&&>
3973 {
using type =
typename remove_cv<_Tp>::type; };
3976 template<
typename _Tp>
3977 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3981#ifdef __cpp_lib_unwrap_ref
3986 template<
typename _Tp>
3987 struct unwrap_reference {
using type = _Tp; };
3989 template<
typename _Tp>
3992 template<
typename _Tp>
3993 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
4000 template<
typename _Tp>
4001 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
4003 template<
typename _Tp>
4004 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
4008#ifdef __cpp_lib_bounded_array_traits
4012# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
4013 template<
typename _Tp>
4014 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
4016 template<
typename _Tp>
4017 inline constexpr bool is_bounded_array_v =
false;
4019 template<
typename _Tp,
size_t _Size>
4020 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
4026# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
4027 template<
typename _Tp>
4028 inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
4030 template<
typename _Tp>
4031 inline constexpr bool is_unbounded_array_v =
false;
4033 template<
typename _Tp>
4034 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
4039 template<
typename _Tp>
4040 struct is_bounded_array
4041 :
public bool_constant<is_bounded_array_v<_Tp>>
4046 template<
typename _Tp>
4047 struct is_unbounded_array
4048 :
public bool_constant<is_unbounded_array_v<_Tp>>
4052#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
4055 template<
typename _Tp,
typename _Up>
4057 : bool_constant<__is_layout_compatible(_Tp, _Up)>
4062 template<
typename _Tp,
typename _Up>
4064 = __is_layout_compatible(_Tp, _Up);
4066#if __has_builtin(__builtin_is_corresponding_member)
4067# ifndef __cpp_lib_is_layout_compatible
4068# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
4072 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
4075 {
return __builtin_is_corresponding_member(__m1, __m2); }
4079#if __has_builtin(__is_pointer_interconvertible_base_of) \
4080 && __cplusplus >= 202002L
4083 template<
typename _Base,
typename _Derived>
4085 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
4090 template<
typename _Base,
typename _Derived>
4092 = __is_pointer_interconvertible_base_of(_Base, _Derived);
4094#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
4095# ifndef __cpp_lib_is_pointer_interconvertible
4096# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
4102 template<
typename _Tp,
typename _Mem>
4105 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
4109#ifdef __cpp_lib_is_scoped_enum
4113# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4114 template<
typename _Tp>
4115 struct is_scoped_enum
4116 : bool_constant<__is_scoped_enum(_Tp)>
4119 template<
typename _Tp>
4120 struct is_scoped_enum
4124 template<
typename _Tp>
4125 requires __is_enum(_Tp)
4126 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
4127 struct is_scoped_enum<_Tp>
4128 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
4134# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4135 template<
typename _Tp>
4136 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
4138 template<
typename _Tp>
4139 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
4143#ifdef __cpp_lib_is_implicit_lifetime
4147 template<
typename _Tp>
4148 struct is_implicit_lifetime
4149 : bool_constant<__builtin_is_implicit_lifetime(_Tp)>
4154 template<
typename _Tp>
4155 inline constexpr bool is_implicit_lifetime_v
4156 = __builtin_is_implicit_lifetime(_Tp);
4159#ifdef __cpp_lib_reference_from_temporary
4164 template<typename _Tp, typename _Up>
4165 struct reference_constructs_from_temporary
4166 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
4168 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
4169 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
4170 "template argument must be a complete class or an unbounded array");
4177 template<
typename _Tp,
typename _Up>
4178 struct reference_converts_from_temporary
4179 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
4181 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
4182 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
4183 "template argument must be a complete class or an unbounded array");
4188 template<
typename _Tp,
typename _Up>
4189 inline constexpr bool reference_constructs_from_temporary_v
4190 = reference_constructs_from_temporary<_Tp, _Up>::value;
4194 template<
typename _Tp,
typename _Up>
4195 inline constexpr bool reference_converts_from_temporary_v
4196 = reference_converts_from_temporary<_Tp, _Up>::value;
4199#ifdef __cpp_lib_is_constant_evaluated
4202 [[__gnu__::__always_inline__]]
4204 is_constant_evaluated() noexcept
4206#if __cpp_if_consteval >= 202106L
4207 if consteval {
return true; }
else {
return false; }
4209 return __builtin_is_constant_evaluated();
4214#if __cplusplus >= 202002L
4216 template<
typename _From,
typename _To>
4217 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
4219 template<
typename _Xp,
typename _Yp>
4223 template<
typename _Ap,
typename _Bp,
typename =
void>
4224 struct __common_ref_impl
4228 template<
typename _Ap,
typename _Bp>
4229 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
4232 template<
typename _Xp,
typename _Yp>
4233 using __condres_cvref
4234 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
4237 template<
typename _Xp,
typename _Yp>
4238 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
4240 __condres_cvref<_Xp, _Yp>>
4244 template<
typename _Xp,
typename _Yp>
4248 template<
typename _Xp,
typename _Yp>
4249 struct __common_ref_impl<_Xp&&, _Yp&&,
4250 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
4251 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
4252 {
using type = __common_ref_C<_Xp, _Yp>; };
4255 template<
typename _Xp,
typename _Yp>
4256 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
4259 template<
typename _Xp,
typename _Yp>
4260 struct __common_ref_impl<_Xp&&, _Yp&,
4261 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
4262 {
using type = __common_ref_D<_Xp, _Yp>; };
4265 template<
typename _Xp,
typename _Yp>
4266 struct __common_ref_impl<_Xp&, _Yp&&>
4267 : __common_ref_impl<_Yp&&, _Xp&>
4271 template<
typename _Tp,
typename _Up,
4272 template<
typename>
class _TQual,
template<
typename>
class _UQual>
4273 struct basic_common_reference
4277 template<
typename _Tp>
4279 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
4281 template<
typename _Tp>
4283 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
4285 template<
typename _Tp>
4286 struct __xref<_Tp&&>
4287 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
4289 template<
typename _Tp1,
typename _Tp2>
4290 using __basic_common_ref
4291 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
4292 remove_cvref_t<_Tp2>,
4293 __xref<_Tp1>::template __type,
4294 __xref<_Tp2>::template __type>::type;
4297 template<
typename... _Tp>
4298 struct common_reference;
4300 template<
typename... _Tp>
4305 struct common_reference<>
4309 template<
typename _Tp0>
4310 struct common_reference<_Tp0>
4311 {
using type = _Tp0; };
4314 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1>
4315 struct __common_reference_impl
4316 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
4320 template<
typename _Tp1,
typename _Tp2>
4321 struct common_reference<_Tp1, _Tp2>
4322 : __common_reference_impl<_Tp1, _Tp2>
4326 template<
typename _Tp1,
typename _Tp2>
4327 requires is_reference_v<_Tp1> && is_reference_v<_Tp2>
4328 &&
requires {
typename __common_ref<_Tp1, _Tp2>; }
4329#if __cpp_lib_common_reference
4330 && is_convertible_v<add_pointer_t<_Tp1>,
4332 && is_convertible_v<add_pointer_t<_Tp2>,
4335 struct __common_reference_impl<_Tp1, _Tp2, 1>
4336 {
using type = __common_ref<_Tp1, _Tp2>; };
4339 template<
typename _Tp1,
typename _Tp2>
4340 requires requires {
typename __basic_common_ref<_Tp1, _Tp2>; }
4341 struct __common_reference_impl<_Tp1, _Tp2, 2>
4342 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
4345 template<
typename _Tp1,
typename _Tp2>
4346 requires requires {
typename __cond_res<_Tp1, _Tp2>; }
4347 struct __common_reference_impl<_Tp1, _Tp2, 3>
4348 {
using type = __cond_res<_Tp1, _Tp2>; };
4351 template<
typename _Tp1,
typename _Tp2>
4353 struct __common_reference_impl<_Tp1, _Tp2, 4>
4354 {
using type = common_type_t<_Tp1, _Tp2>; };
4357 template<
typename _Tp1,
typename _Tp2>
4358 struct __common_reference_impl<_Tp1, _Tp2, 5>
4362 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4363 struct common_reference<_Tp1, _Tp2, _Rest...>
4364 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4365 __common_type_pack<_Rest...>>
4369 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4370 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4371 __common_type_pack<_Rest...>,
4373 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4379#if __cplusplus >= 201103L
4382 template<
size_t... _Indexes>
struct _Index_tuple { };
4385 template<
size_t _Num>
4386 struct _Build_index_tuple
4388#if __has_builtin(__make_integer_seq)
4389 template<
typename,
size_t... _Indices>
4390 using _IdxTuple = _Index_tuple<_Indices...>;
4393 using __type = __make_integer_seq<_IdxTuple, size_t, _Num>;
4396 using __type = _Index_tuple<__integer_pack(_Num)...>;
4403_GLIBCXX_END_NAMESPACE_VERSION
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
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.
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.