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>;
168 template <
typename _Type>
169 struct __type_identity
170 {
using type = _Type; };
172 template<
typename _Tp>
173 using __type_identity_t =
typename __type_identity<_Tp>::type;
178 template<
typename _Tp,
typename...>
179 using __first_t = _Tp;
182 template<
typename... _Bn>
184 __enable_if_t<!bool(_Bn::value)>...>;
186 template<
typename... _Bn>
189 template<
typename... _Bn>
190 auto __and_fn(
int) -> __first_t<
true_type,
191 __enable_if_t<bool(_Bn::value)>...>;
193 template<
typename... _Bn>
200 template<
typename... _Bn>
202 : decltype(__detail::__or_fn<_Bn...>(0))
205 template<
typename... _Bn>
207 : decltype(__detail::__and_fn<_Bn...>(0))
210 template<
typename _Pp>
212 : __bool_constant<!bool(_Pp::value)>
216#ifdef __cpp_lib_logical_traits
219 template<
typename... _Bn>
220 inline constexpr bool __or_v = __or_<_Bn...>::value;
221 template<
typename... _Bn>
222 inline constexpr bool __and_v = __and_<_Bn...>::value;
226 template<
typename ,
typename _B1,
typename... _Bn>
227 struct __disjunction_impl
228 {
using type = _B1; };
230 template<
typename _B1,
typename _B2,
typename... _Bn>
231 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
232 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
234 template<
typename ,
typename _B1,
typename... _Bn>
235 struct __conjunction_impl
236 {
using type = _B1; };
238 template<
typename _B1,
typename _B2,
typename... _Bn>
239 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
240 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
244 template<
typename... _Bn>
246 : __detail::__conjunction_impl<void, _Bn...>::type
254 template<
typename... _Bn>
256 : __detail::__disjunction_impl<void, _Bn...>::type
264 template<
typename _Pp>
272 template<
typename... _Bn>
273 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
275 template<
typename... _Bn>
276 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
278 template<
typename _Pp>
279 inline constexpr bool negation_v = negation<_Pp>::value;
294 struct __is_array_unknown_bounds;
299 template<
typename _Tp>
300 using __maybe_complete_object_type
301 = __and_<is_object<_Tp>, __not_<__is_array_unknown_bounds<_Tp>>>;
307 template<
typename _Tp,
308 typename = __enable_if_t<__maybe_complete_object_type<_Tp>::value>,
309 size_t =
sizeof(_Tp)>
311 __is_complete_or_unbounded(__type_identity<_Tp>)
316 template<
typename _TypeIdentity,
317 typename _NestedType =
typename _TypeIdentity::type>
318 constexpr typename __not_<__maybe_complete_object_type<_NestedType>>::type
319 __is_complete_or_unbounded(_TypeIdentity)
323 template<
typename _Tp>
324 using __remove_cv_t =
typename remove_cv<_Tp>::type;
330 template<
typename _Tp>
339 struct is_void<const void>
340 :
public true_type { };
347 struct is_void<const volatile void>
356 enum class _Integer_kind { _None, _Signed, _Unsigned };
359 struct __is_integral_helper
361 {
static constexpr auto _S_kind = _Integer_kind::_None; };
364 struct __is_integral_helper<bool>
366 {
static constexpr auto _S_kind = _Integer_kind::_None; };
369 struct __is_integral_helper<char>
371 {
static constexpr auto _S_kind = _Integer_kind::_None; };
374 struct __is_integral_helper<signed char>
376 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
379 struct __is_integral_helper<unsigned char>
381 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
387 struct __is_integral_helper<wchar_t>
389 {
static constexpr auto _S_kind = _Integer_kind::_None; };
391#ifdef _GLIBCXX_USE_CHAR8_T
393 struct __is_integral_helper<char8_t>
395 {
static constexpr auto _S_kind = _Integer_kind::_None; };
399 struct __is_integral_helper<char16_t>
401 {
static constexpr auto _S_kind = _Integer_kind::_None; };
404 struct __is_integral_helper<char32_t>
406 {
static constexpr auto _S_kind = _Integer_kind::_None; };
409 struct __is_integral_helper<short>
411 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
414 struct __is_integral_helper<unsigned short>
416 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
419 struct __is_integral_helper<int>
421 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
424 struct __is_integral_helper<unsigned int>
426 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
429 struct __is_integral_helper<long>
431 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
434 struct __is_integral_helper<unsigned long>
436 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
439 struct __is_integral_helper<long long>
441 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
444 struct __is_integral_helper<unsigned long long>
446 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
450#if defined(__GLIBCXX_TYPE_INT_N_0)
453 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
455 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
459 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
461 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
463#if defined(__GLIBCXX_TYPE_INT_N_1)
466 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
468 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
472 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
474 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
476#if defined(__GLIBCXX_TYPE_INT_N_2)
479 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
481 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
485 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
487 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
489#if defined(__GLIBCXX_TYPE_INT_N_3)
492 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
494 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
498 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
500 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
503#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
506 struct __is_integral_helper<__int128>
508 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
512 struct __is_integral_helper<unsigned __int128>
514 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
518 template<
typename _Tp>
519 using __is_signed_integer
520 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
521 == _Integer_kind::_Signed>;
524 template<
typename _Tp>
525 using __is_unsigned_integer
526 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
527 == _Integer_kind::_Unsigned>;
531 template<
typename _Tp>
532 using __is_signed_or_unsigned_integer
533 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
534 != _Integer_kind::_None>;
539 template<
typename _Tp>
541 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
546 struct __is_floating_point_helper
550 struct __is_floating_point_helper<float>
551 :
public true_type { };
554 struct __is_floating_point_helper<double>
558 struct __is_floating_point_helper<long double>
561#ifdef __STDCPP_FLOAT16_T__
563 struct __is_floating_point_helper<_Float16>
567#ifdef __STDCPP_FLOAT32_T__
569 struct __is_floating_point_helper<_Float32>
573#ifdef __STDCPP_FLOAT64_T__
575 struct __is_floating_point_helper<_Float64>
579#ifdef __STDCPP_FLOAT128_T__
581 struct __is_floating_point_helper<_Float128>
585#ifdef __STDCPP_BFLOAT16_T__
587 struct __is_floating_point_helper<__gnu_cxx::__bfloat16_t>
591#ifdef _GLIBCXX_USE_FLOAT128
593 struct __is_floating_point_helper<__float128>
599 template<
typename _Tp>
601 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
605#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
606 template<
typename _Tp>
608 :
public __bool_constant<__is_array(_Tp)>
615 template<
typename _Tp, std::
size_t _Size>
616 struct is_array<_Tp[_Size]>
617 :
public true_type { };
619 template<
typename _Tp>
625#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
626 template<
typename _Tp>
628 :
public __bool_constant<__is_pointer(_Tp)>
631 template<
typename _Tp>
635 template<
typename _Tp>
636 struct is_pointer<_Tp*>
637 :
public true_type { };
639 template<
typename _Tp>
643 template<
typename _Tp>
647 template<
typename _Tp>
657 template<
typename _Tp>
666 template<
typename _Tp>
671#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
672 template<
typename _Tp>
674 :
public __bool_constant<__is_member_object_pointer(_Tp)>
677 template<
typename _Tp>
681 struct __is_member_object_pointer_helper
684 template<
typename _Tp,
typename _Cp>
685 struct __is_member_object_pointer_helper<_Tp _Cp::*>
686 :
public __not_<is_function<_Tp>>::type { };
689 template<
typename _Tp>
691 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
695#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
697 template<
typename _Tp>
699 :
public __bool_constant<__is_member_function_pointer(_Tp)>
702 template<
typename _Tp>
706 struct __is_member_function_pointer_helper
709 template<
typename _Tp,
typename _Cp>
710 struct __is_member_function_pointer_helper<_Tp _Cp::*>
711 :
public is_function<_Tp>::type { };
714 template<
typename _Tp>
716 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
721 template<
typename _Tp>
723 :
public __bool_constant<__is_enum(_Tp)>
727 template<
typename _Tp>
729 :
public __bool_constant<__is_union(_Tp)>
733 template<
typename _Tp>
735 :
public __bool_constant<__is_class(_Tp)>
739#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
740 template<
typename _Tp>
742 :
public __bool_constant<__is_function(_Tp)>
745 template<
typename _Tp>
747 :
public __bool_constant<!is_const<const _Tp>::value> { };
749 template<
typename _Tp>
750 struct is_function<_Tp&>
751 :
public false_type { };
753 template<
typename _Tp>
758#if __cpp_impl_reflection >= 202506L
760 template<typename _Tp>
765 struct is_reflection<decltype(^^int)>
769 struct is_reflection<const decltype(^^int)>
773 struct is_reflection<volatile decltype(^^int)>
777 struct is_reflection<const volatile decltype(^^int)>
781#ifdef __cpp_lib_is_null_pointer
783 template<typename _Tp>
784 struct is_null_pointer
788 struct is_null_pointer<std::nullptr_t>
792 struct is_null_pointer<const std::nullptr_t>
796 struct is_null_pointer<volatile std::nullptr_t>
800 struct is_null_pointer<const volatile std::nullptr_t>
805 template<
typename _Tp>
806 struct __is_nullptr_t
807 :
public is_null_pointer<_Tp>
808 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
814#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
815 template<
typename _Tp>
817 :
public __bool_constant<__is_reference(_Tp)>
820 template<
typename _Tp>
825 template<
typename _Tp>
826 struct is_reference<_Tp&>
830 template<
typename _Tp>
837 template<
typename _Tp>
839 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
843 template<
typename _Tp>
845 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
847#if __cpp_impl_reflection >= 202506L
854#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
855 template<
typename _Tp>
857 :
public __bool_constant<__is_object(_Tp)>
860 template<
typename _Tp>
862 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
868 struct is_member_pointer;
871 template<
typename _Tp>
873 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
874 is_member_pointer<_Tp>, is_null_pointer<_Tp>
875#if __cpp_impl_reflection >= 202506L
882 template<
typename _Tp>
884 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
887#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
888 template<
typename _Tp>
890 :
public __bool_constant<__is_member_pointer(_Tp)>
894 template<
typename _Tp>
895 struct __is_member_pointer_helper
898 template<
typename _Tp,
typename _Cp>
899 struct __is_member_pointer_helper<_Tp _Cp::*>
900 :
public true_type { };
903 template<
typename _Tp>
905 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
909 template<
typename,
typename>
913 template<
typename _Tp,
typename... _Types>
914 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
917 template<
typename...>
using __void_t = void;
923#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
924 template<
typename _Tp>
926 :
public __bool_constant<__is_const(_Tp)>
933 template<
typename _Tp>
934 struct is_const<_Tp const>
935 :
public true_type { };
939#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
940 template<
typename _Tp>
942 :
public __bool_constant<__is_volatile(_Tp)>
949 template<
typename _Tp>
950 struct is_volatile<_Tp volatile>
951 :
public true_type { };
961 template<
typename _Tp>
963 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible && is_trivially_copyable")
965 : public __bool_constant<__is_trivial(_Tp)>
967 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
968 "template argument must be a complete class or an unbounded array");
972 template<
typename _Tp>
974 :
public __bool_constant<__is_trivially_copyable(_Tp)>
976 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
977 "template argument must be a complete class or an unbounded array");
981 template<
typename _Tp>
983 :
public __bool_constant<__is_standard_layout(_Tp)>
985 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
986 "template argument must be a complete class or an unbounded array");
994 template<
typename _Tp>
996 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
998 : public __bool_constant<__is_pod(_Tp)>
1000 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1001 "template argument must be a complete class or an unbounded array");
1008 template<
typename _Tp>
1010 _GLIBCXX17_DEPRECATED
1012 :
public __bool_constant<__is_literal_type(_Tp)>
1014 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1015 "template argument must be a complete class or an unbounded array");
1019 template<
typename _Tp>
1021 :
public __bool_constant<__is_empty(_Tp)>
1025 template<
typename _Tp>
1027 :
public __bool_constant<__is_polymorphic(_Tp)>
1030#ifdef __cpp_lib_is_final
1033 template<typename _Tp>
1035 :
public __bool_constant<__is_final(_Tp)>
1040 template<
typename _Tp>
1042 :
public __bool_constant<__is_abstract(_Tp)>
1046 template<
typename _Tp,
1048 struct __is_signed_helper
1051 template<
typename _Tp>
1052 struct __is_signed_helper<_Tp, true>
1053 :
public __bool_constant<_Tp(-1) < _Tp(0)>
1058 template<typename _Tp>
1060 : public __is_signed_helper<_Tp>::type
1064 template<typename _Tp>
1066 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
1070 template<typename _Tp, typename _Up = _Tp&&>
1074 template<typename _Tp>
1079 template<typename _Tp>
1080 auto declval() noexcept -> decltype(__declval<_Tp>(0));
1086 template<typename _Tp>
1087 struct __is_array_known_bounds
1091 template<
typename _Tp,
size_t _Size>
1092 struct __is_array_known_bounds<_Tp[_Size]>
1096 template<
typename _Tp>
1097 struct __is_array_unknown_bounds
1101 template<
typename _Tp>
1102 struct __is_array_unknown_bounds<_Tp[]>
1109#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
1111 template<
typename _Tp>
1113 :
public __bool_constant<__is_destructible(_Tp)>
1123 struct __do_is_destructible_impl
1125 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1132 template<
typename _Tp>
1133 struct __is_destructible_impl
1134 :
public __do_is_destructible_impl
1136 using type =
decltype(__test<_Tp>(0));
1139 template<
typename _Tp,
1140 bool = __or_<is_void<_Tp>,
1141 __is_array_unknown_bounds<_Tp>,
1144 struct __is_destructible_safe;
1146 template<
typename _Tp>
1147 struct __is_destructible_safe<_Tp, false, false>
1148 :
public __is_destructible_impl<typename
1149 remove_all_extents<_Tp>::type>::type
1152 template<
typename _Tp>
1153 struct __is_destructible_safe<_Tp, true, false>
1156 template<
typename _Tp>
1157 struct __is_destructible_safe<_Tp, false, true>
1162 template<
typename _Tp>
1164 :
public __is_destructible_safe<_Tp>::type
1166 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1167 "template argument must be a complete class or an unbounded array");
1171#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
1173 template<
typename _Tp>
1175 :
public __bool_constant<__is_nothrow_destructible(_Tp)>
1184 struct __do_is_nt_destructible_impl
1186 template<
typename _Tp>
1187 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1194 template<
typename _Tp>
1195 struct __is_nt_destructible_impl
1196 :
public __do_is_nt_destructible_impl
1198 using type =
decltype(__test<_Tp>(0));
1201 template<
typename _Tp,
1202 bool = __or_<is_void<_Tp>,
1203 __is_array_unknown_bounds<_Tp>,
1206 struct __is_nt_destructible_safe;
1208 template<
typename _Tp>
1209 struct __is_nt_destructible_safe<_Tp, false, false>
1210 :
public __is_nt_destructible_impl<typename
1211 remove_all_extents<_Tp>::type>::type
1214 template<
typename _Tp>
1215 struct __is_nt_destructible_safe<_Tp, true, false>
1218 template<
typename _Tp>
1219 struct __is_nt_destructible_safe<_Tp, false, true>
1224 template<
typename _Tp>
1226 :
public __is_nt_destructible_safe<_Tp>::type
1228 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1229 "template argument must be a complete class or an unbounded array");
1234 template<
typename _Tp,
typename... _Args>
1235 using __is_constructible_impl
1236 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1240 template<
typename _Tp,
typename... _Args>
1242 :
public __is_constructible_impl<_Tp, _Args...>
1244 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1245 "template argument must be a complete class or an unbounded array");
1249 template<
typename _Tp>
1251 :
public __is_constructible_impl<_Tp>
1253 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1254 "template argument must be a complete class or an unbounded array");
1258#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_lvalue_reference)
1259 template<
typename _Tp>
1260 using __add_lval_ref_t = __add_lvalue_reference(_Tp);
1262 template<
typename _Tp,
typename =
void>
1263 struct __add_lvalue_reference_helper
1264 {
using type = _Tp; };
1266 template<
typename _Tp>
1267 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1268 {
using type = _Tp&; };
1270 template<
typename _Tp>
1271 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1276 template<
typename _Tp>
1278 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1280 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1281 "template argument must be a complete class or an unbounded array");
1285#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_rvalue_reference)
1286 template<
typename _Tp>
1287 using __add_rval_ref_t = __add_rvalue_reference(_Tp);
1289 template<
typename _Tp,
typename =
void>
1290 struct __add_rvalue_reference_helper
1291 {
using type = _Tp; };
1293 template<
typename _Tp>
1294 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1295 {
using type = _Tp&&; };
1297 template<
typename _Tp>
1298 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1303 template<
typename _Tp>
1305 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1307 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1308 "template argument must be a complete class or an unbounded array");
1312 template<
typename _Tp,
typename... _Args>
1313 using __is_nothrow_constructible_impl
1314 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1318 template<
typename _Tp,
typename... _Args>
1320 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1322 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1323 "template argument must be a complete class or an unbounded array");
1327 template<
typename _Tp>
1329 :
public __is_nothrow_constructible_impl<_Tp>
1331 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1332 "template argument must be a complete class or an unbounded array");
1336 template<
typename _Tp>
1338 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1340 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1341 "template argument must be a complete class or an unbounded array");
1345 template<
typename _Tp>
1347 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1349 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1350 "template argument must be a complete class or an unbounded array");
1354 template<
typename _Tp,
typename _Up>
1355 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1359 template<
typename _Tp,
typename _Up>
1361 :
public __is_assignable_impl<_Tp, _Up>
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_assignable_impl<__add_lval_ref_t<_Tp>,
1371 __add_lval_ref_t<const _Tp>>
1373 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1374 "template argument must be a complete class or an unbounded array");
1378 template<
typename _Tp>
1380 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1382 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1383 "template argument must be a complete class or an unbounded array");
1387 template<
typename _Tp,
typename _Up>
1388 using __is_nothrow_assignable_impl
1389 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1393 template<
typename _Tp,
typename _Up>
1395 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1397 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1398 "template argument must be a complete class or an unbounded array");
1402 template<
typename _Tp>
1404 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1405 __add_lval_ref_t<const _Tp>>
1407 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1408 "template argument must be a complete class or an unbounded array");
1412 template<
typename _Tp>
1414 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1415 __add_rval_ref_t<_Tp>>
1417 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1418 "template argument must be a complete class or an unbounded array");
1422 template<
typename _Tp,
typename... _Args>
1423 using __is_trivially_constructible_impl
1424 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1428 template<
typename _Tp,
typename... _Args>
1430 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1432 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1433 "template argument must be a complete class or an unbounded array");
1437 template<
typename _Tp>
1439 :
public __is_trivially_constructible_impl<_Tp>
1441 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1442 "template argument must be a complete class or an unbounded array");
1445#if __cpp_variable_templates && __cpp_concepts
1446 template<
typename _Tp>
1447 constexpr bool __is_implicitly_default_constructible_v
1448 =
requires (void(&__f)(_Tp)) { __f({}); };
1450 template<
typename _Tp>
1451 struct __is_implicitly_default_constructible
1452 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1455 struct __do_is_implicitly_default_constructible_impl
1457 template <
typename _Tp>
1458 static void __helper(
const _Tp&);
1460 template <
typename _Tp>
1462 decltype(__helper<const _Tp&>({}))* = 0);
1467 template<
typename _Tp>
1468 struct __is_implicitly_default_constructible_impl
1469 :
public __do_is_implicitly_default_constructible_impl
1474 template<
typename _Tp>
1475 struct __is_implicitly_default_constructible_safe
1476 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1479 template <
typename _Tp>
1480 struct __is_implicitly_default_constructible
1481 :
public __and_<__is_constructible_impl<_Tp>,
1482 __is_implicitly_default_constructible_safe<_Tp>>::type
1487 template<
typename _Tp>
1489 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1491 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1492 "template argument must be a complete class or an unbounded array");
1496 template<
typename _Tp>
1498 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1500 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1501 "template argument must be a complete class or an unbounded array");
1505 template<
typename _Tp,
typename _Up>
1506 using __is_trivially_assignable_impl
1507 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1511 template<
typename _Tp,
typename _Up>
1513 :
public __is_trivially_assignable_impl<_Tp, _Up>
1515 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1516 "template argument must be a complete class or an unbounded array");
1520 template<
typename _Tp>
1522 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1523 __add_lval_ref_t<const _Tp>>
1525 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1526 "template argument must be a complete class or an unbounded array");
1530 template<
typename _Tp>
1532 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1533 __add_rval_ref_t<_Tp>>
1535 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1536 "template argument must be a complete class or an unbounded array");
1539#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
1541 template<
typename _Tp>
1543 :
public __bool_constant<__is_trivially_destructible(_Tp)>
1547 template<
typename _Tp>
1549 :
public __and_<__is_destructible_safe<_Tp>,
1550 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1552 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1553 "template argument must be a complete class or an unbounded array");
1558 template<
typename _Tp>
1560 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1562 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1563 "template argument must be a complete class or an unbounded array");
1570 template<
typename _Tp>
1574 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1575 "template argument must be a complete class or an unbounded array");
1579#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
1580 && (!defined(__clang__) || __clang_major__ >= 20)
1581 template<
typename _Tp>
1589 template<
typename _Tp, std::
size_t _Size>
1590 struct rank<_Tp[_Size]>
1591 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1593 template<
typename _Tp>
1599 template<
typename,
unsigned _U
int = 0>
1603 template<
typename _Tp,
size_t _Size>
1604 struct extent<_Tp[_Size], 0>
1607 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1608 struct extent<_Tp[_Size], _Uint>
1609 :
public extent<_Tp, _Uint - 1>::type { };
1611 template<
typename _Tp>
1615 template<
typename _Tp,
unsigned _U
int>
1616 struct extent<_Tp[], _Uint>
1617 :
public extent<_Tp, _Uint - 1>::type { };
1623#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1624 template<
typename _Tp,
typename _Up>
1626 :
public __bool_constant<__is_same(_Tp, _Up)>
1629 template<
typename _Tp,
typename _Up>
1634 template<
typename _Tp>
1635 struct is_same<_Tp, _Tp>
1641 template<
typename _Base,
typename _Derived>
1643 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1646#ifdef __cpp_lib_is_virtual_base_of
1649 template<typename _Base, typename _Derived>
1650 struct is_virtual_base_of
1651 :
public bool_constant<__builtin_is_virtual_base_of(_Base, _Derived)>
1655#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1656 template<
typename _From,
typename _To>
1657 struct is_convertible
1658 :
public __bool_constant<__is_convertible(_From, _To)>
1661 template<
typename _From,
typename _To,
1664 struct __is_convertible_helper
1666 using type =
typename is_void<_To>::type;
1669#pragma GCC diagnostic push
1670#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1671 template<
typename _From,
typename _To>
1672 class __is_convertible_helper<_From, _To, false>
1674 template<
typename _To1>
1675 static void __test_aux(_To1)
noexcept;
1677 template<
typename _From1,
typename _To1,
1682 template<
typename,
typename>
1687 using type =
decltype(__test<_From, _To>(0));
1689#pragma GCC diagnostic pop
1692 template<
typename _From,
typename _To>
1693 struct is_convertible
1694 :
public __is_convertible_helper<_From, _To>::type
1699 template<
typename _ToElementType,
typename _FromElementType>
1700 using __is_array_convertible
1701 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1703#ifdef __cpp_lib_is_nothrow_convertible
1705#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1707 template<
typename _From,
typename _To>
1708 inline constexpr bool is_nothrow_convertible_v
1709 = __is_nothrow_convertible(_From, _To);
1712 template<
typename _From,
typename _To>
1713 struct is_nothrow_convertible
1714 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1717 template<
typename _From,
typename _To,
1720 struct __is_nt_convertible_helper
1724#pragma GCC diagnostic push
1725#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1726 template<
typename _From,
typename _To>
1727 class __is_nt_convertible_helper<_From, _To, false>
1729 template<
typename _To1>
1730 static void __test_aux(_To1)
noexcept;
1732 template<
typename _From1,
typename _To1>
1737 template<
typename,
typename>
1742 using type =
decltype(__test<_From, _To>(0));
1744#pragma GCC diagnostic pop
1747 template<
typename _From,
typename _To>
1748 struct is_nothrow_convertible
1749 :
public __is_nt_convertible_helper<_From, _To>::type
1753 template<
typename _From,
typename _To>
1754 inline constexpr bool is_nothrow_convertible_v
1755 = is_nothrow_convertible<_From, _To>::value;
1759#pragma GCC diagnostic push
1760#pragma GCC diagnostic ignored "-Wc++14-extensions"
1761 template<
typename _Tp,
typename... _Args>
1762 struct __is_nothrow_new_constructible_impl
1764 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1768 template<
typename _Tp,
typename... _Args>
1769 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1771 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1772#pragma GCC diagnostic pop
1777 template<
typename _Tp>
1779 {
using type = _Tp; };
1781 template<
typename _Tp>
1783 {
using type = _Tp; };
1786 template<
typename _Tp>
1788 {
using type = _Tp; };
1790 template<
typename _Tp>
1792 {
using type = _Tp; };
1795#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1796 template<
typename _Tp>
1798 {
using type = __remove_cv(_Tp); };
1800 template<
typename _Tp>
1802 {
using type = _Tp; };
1804 template<
typename _Tp>
1805 struct remove_cv<const _Tp>
1806 {
using type = _Tp; };
1808 template<
typename _Tp>
1810 {
using type = _Tp; };
1812 template<
typename _Tp>
1814 {
using type = _Tp; };
1818 template<
typename _Tp>
1820 {
using type = _Tp
const; };
1823 template<
typename _Tp>
1825 {
using type = _Tp
volatile; };
1828 template<
typename _Tp>
1830 {
using type = _Tp
const volatile; };
1832#ifdef __cpp_lib_transformation_trait_aliases
1834 template<typename _Tp>
1835 using remove_const_t =
typename remove_const<_Tp>::type;
1838 template<
typename _Tp>
1839 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1842 template<
typename _Tp>
1843 using remove_cv_t =
typename remove_cv<_Tp>::type;
1846 template<
typename _Tp>
1847 using add_const_t =
typename add_const<_Tp>::type;
1850 template<
typename _Tp>
1851 using add_volatile_t =
typename add_volatile<_Tp>::type;
1854 template<
typename _Tp>
1855 using add_cv_t =
typename add_cv<_Tp>::type;
1861#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1862 template<
typename _Tp>
1864 {
using type = __remove_reference(_Tp); };
1866 template<
typename _Tp>
1868 {
using type = _Tp; };
1870 template<
typename _Tp>
1871 struct remove_reference<_Tp&>
1872 {
using type = _Tp; };
1874 template<
typename _Tp>
1876 {
using type = _Tp; };
1880 template<
typename _Tp>
1882 {
using type = __add_lval_ref_t<_Tp>; };
1885 template<
typename _Tp>
1887 {
using type = __add_rval_ref_t<_Tp>; };
1889#if __cplusplus > 201103L
1891 template<
typename _Tp>
1895 template<
typename _Tp>
1899 template<
typename _Tp>
1908 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1909 struct __cv_selector;
1911 template<
typename _Unqualified>
1912 struct __cv_selector<_Unqualified, false, false>
1913 {
using __type = _Unqualified; };
1915 template<
typename _Unqualified>
1916 struct __cv_selector<_Unqualified, false, true>
1917 {
using __type =
volatile _Unqualified; };
1919 template<
typename _Unqualified>
1920 struct __cv_selector<_Unqualified, true, false>
1921 {
using __type =
const _Unqualified; };
1923 template<
typename _Unqualified>
1924 struct __cv_selector<_Unqualified, true, true>
1925 {
using __type =
const volatile _Unqualified; };
1927 template<
typename _Qualified,
typename _Unqualified,
1930 class __match_cv_qualifiers
1932 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1935 using __type =
typename __match::__type;
1939 template<
typename _Tp>
1940 struct __make_unsigned
1941 {
using __type = _Tp; };
1944 struct __make_unsigned<char>
1945 {
using __type =
unsigned char; };
1948 struct __make_unsigned<signed char>
1949 {
using __type =
unsigned char; };
1952 struct __make_unsigned<short>
1953 {
using __type =
unsigned short; };
1956 struct __make_unsigned<int>
1957 {
using __type =
unsigned int; };
1960 struct __make_unsigned<long>
1961 {
using __type =
unsigned long; };
1964 struct __make_unsigned<long long>
1965 {
using __type =
unsigned long long; };
1967#if defined(__GLIBCXX_TYPE_INT_N_0)
1970 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1971 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1973#if defined(__GLIBCXX_TYPE_INT_N_1)
1976 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1977 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
1979#if defined(__GLIBCXX_TYPE_INT_N_2)
1982 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1983 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
1985#if defined(__GLIBCXX_TYPE_INT_N_3)
1988 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1989 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
1991#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
1994 struct __make_unsigned<__int128>
1995 {
using __type =
unsigned __int128; };
1999 template<
typename _Tp,
2001 bool _IsEnum = __is_enum(_Tp)>
2002 class __make_unsigned_selector;
2004 template<
typename _Tp>
2005 class __make_unsigned_selector<_Tp, true, false>
2007 using __unsigned_type
2008 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
2012 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2015 class __make_unsigned_selector_base
2018 template<
typename...>
struct _List { };
2020 template<
typename _Tp,
typename... _Up>
2021 struct _List<_Tp, _Up...> : _List<_Up...>
2022 {
static constexpr size_t __size =
sizeof(_Tp); };
2024 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
2027 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
2028 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
2029 {
using __type = _Uint; };
2031 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
2032 struct __select<_Sz, _List<_Uint, _UInts...>, false>
2033 : __select<_Sz, _List<_UInts...>>
2038 template<
typename _Tp>
2039 class __make_unsigned_selector<_Tp, false, true>
2040 : __make_unsigned_selector_base
2044 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
2045 unsigned long,
unsigned long long
2046#ifdef __SIZEOF_INT128__
2051 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
2055 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2063 struct __make_unsigned<wchar_t>
2066 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
2069#ifdef _GLIBCXX_USE_CHAR8_T
2071 struct __make_unsigned<char8_t>
2074 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
2079 struct __make_unsigned<char16_t>
2082 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
2086 struct __make_unsigned<char32_t>
2089 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
2097 template<
typename _Tp>
2099 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
2110 template<
typename _Tp>
2111 struct __make_signed
2112 {
using __type = _Tp; };
2115 struct __make_signed<char>
2116 {
using __type =
signed char; };
2119 struct __make_signed<unsigned char>
2120 {
using __type =
signed char; };
2123 struct __make_signed<unsigned short>
2124 {
using __type =
signed short; };
2127 struct __make_signed<unsigned int>
2128 {
using __type =
signed int; };
2131 struct __make_signed<unsigned long>
2132 {
using __type =
signed long; };
2135 struct __make_signed<unsigned long long>
2136 {
using __type =
signed long long; };
2138#if defined(__GLIBCXX_TYPE_INT_N_0)
2141 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
2142 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
2144#if defined(__GLIBCXX_TYPE_INT_N_1)
2147 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
2148 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
2150#if defined(__GLIBCXX_TYPE_INT_N_2)
2153 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
2154 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
2156#if defined(__GLIBCXX_TYPE_INT_N_3)
2159 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
2160 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
2162#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
2165 struct __make_signed<unsigned __int128>
2166 {
using __type = __int128; };
2170 template<
typename _Tp,
2172 bool _IsEnum = __is_enum(_Tp)>
2173 class __make_signed_selector;
2175 template<
typename _Tp>
2176 class __make_signed_selector<_Tp, true, false>
2179 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2183 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2187 template<
typename _Tp>
2188 class __make_signed_selector<_Tp, false, true>
2190 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2193 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2201 struct __make_signed<wchar_t>
2204 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2207#if defined(_GLIBCXX_USE_CHAR8_T)
2209 struct __make_signed<char8_t>
2212 =
typename __make_signed_selector<char8_t, false, true>::__type;
2217 struct __make_signed<char16_t>
2220 =
typename __make_signed_selector<char16_t, false, true>::__type;
2224 struct __make_signed<char32_t>
2227 =
typename __make_signed_selector<char32_t, false, true>::__type;
2235 template<
typename _Tp>
2237 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2243 template<>
struct make_signed<bool const volatile>;
2245#if __cplusplus > 201103L
2247 template<
typename _Tp>
2251 template<
typename _Tp>
2258#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent)
2259 template<
typename _Tp>
2261 {
using type = __remove_extent(_Tp); };
2263 template<
typename _Tp>
2265 {
using type = _Tp; };
2267 template<
typename _Tp, std::
size_t _Size>
2268 struct remove_extent<_Tp[_Size]>
2269 {
using type = _Tp; };
2271 template<
typename _Tp>
2273 {
using type = _Tp; };
2277#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_all_extents)
2278 template<
typename _Tp>
2280 {
using type = __remove_all_extents(_Tp); };
2282 template<
typename _Tp>
2284 {
using type = _Tp; };
2286 template<
typename _Tp, std::
size_t _Size>
2287 struct remove_all_extents<_Tp[_Size]>
2288 {
using type =
typename remove_all_extents<_Tp>::type; };
2290 template<
typename _Tp>
2292 {
using type =
typename remove_all_extents<_Tp>::type; };
2295#if __cplusplus > 201103L
2297 template<
typename _Tp>
2301 template<
typename _Tp>
2308#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2309 template<
typename _Tp>
2311 {
using type = __remove_pointer(_Tp); };
2313 template<
typename _Tp,
typename>
2314 struct __remove_pointer_helper
2315 {
using type = _Tp; };
2317 template<
typename _Tp,
typename _Up>
2318 struct __remove_pointer_helper<_Tp, _Up*>
2319 {
using type = _Up; };
2321 template<
typename _Tp>
2323 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2328#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_pointer)
2329 template<
typename _Tp>
2331 {
using type = __add_pointer(_Tp); };
2333 template<
typename _Tp,
typename =
void>
2334 struct __add_pointer_helper
2335 {
using type = _Tp; };
2337 template<
typename _Tp>
2338 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2339 {
using type = _Tp*; };
2341 template<
typename _Tp>
2343 :
public __add_pointer_helper<_Tp>
2346 template<
typename _Tp>
2348 {
using type = _Tp*; };
2350 template<
typename _Tp>
2352 {
using type = _Tp*; };
2355#if __cplusplus > 201103L
2357 template<
typename _Tp>
2361 template<
typename _Tp>
2368 struct __attribute__((__aligned__)) __aligned_storage_max_align_t
2372 __aligned_storage_default_alignment([[__maybe_unused__]]
size_t __len)
2374#if _GLIBCXX_INLINE_VERSION
2376 = integral_constant<size_t,
alignof(__aligned_storage_max_align_t)>;
2378 return __len > (_Max_align::value / 2)
2380#
if _GLIBCXX_USE_BUILTIN_TRAIT(__builtin_clzg)
2381 : 1 << (__SIZE_WIDTH__ - __builtin_clzg(__len - 1u));
2383 : 1 << (__LLONG_WIDTH__ - __builtin_clzll(__len - 1ull));
2388 return alignof(__aligned_storage_max_align_t);
2424 template<
size_t _Len,
2425 size_t _Align = __aligned_storage_default_alignment(_Len)>
2427 _GLIBCXX23_DEPRECATED
2432 alignas(_Align)
unsigned char __data[_Len];
2436 template <
typename... _Types>
2437 struct __strictest_alignment
2439 static const size_t _S_alignment = 0;
2440 static const size_t _S_size = 0;
2443 template <
typename _Tp,
typename... _Types>
2444 struct __strictest_alignment<_Tp, _Types...>
2446 static const size_t _S_alignment =
2447 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2448 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2449 static const size_t _S_size =
2450 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2451 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2454#pragma GCC diagnostic push
2455#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2469 template <
size_t _Len,
typename... _Types>
2471 _GLIBCXX23_DEPRECATED
2475 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2477 using __strictest = __strictest_alignment<_Types...>;
2478 static const size_t _S_len = _Len > __strictest::_S_size
2479 ? _Len : __strictest::_S_size;
2484 using type =
typename aligned_storage<_S_len, alignment_value>::type;
2487 template <
size_t _Len,
typename... _Types>
2488 const size_t aligned_union<_Len, _Types...>::alignment_value;
2489#pragma GCC diagnostic pop
2493#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
2494 template<
typename _Tp>
2496 {
using type = __decay(_Tp); };
2500 template<
typename _Up>
2501 struct __decay_selector
2502 : __conditional_t<is_const<const _Up>::value,
2507 template<
typename _Up,
size_t _Nm>
2508 struct __decay_selector<_Up[_Nm]>
2509 {
using type = _Up*; };
2511 template<
typename _Up>
2512 struct __decay_selector<_Up[]>
2513 {
using type = _Up*; };
2518 template<
typename _Tp>
2520 {
using type =
typename __decay_selector<_Tp>::type; };
2522 template<
typename _Tp>
2524 {
using type =
typename __decay_selector<_Tp>::type; };
2526 template<
typename _Tp>
2528 {
using type =
typename __decay_selector<_Tp>::type; };
2534 template<
typename _Tp>
2535 struct __strip_reference_wrapper
2540 template<
typename _Tp>
2543 using __type = _Tp&;
2547 template<
typename _Tp>
2548 using __decay_t =
typename decay<_Tp>::type;
2550 template<
typename _Tp>
2551 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2557 template<
typename... _Cond>
2558 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2561 template<
typename _Tp>
2562 using __remove_cvref_t
2568 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2570 {
using type = _Iftrue; };
2573 template<
typename _Iftrue,
typename _Iffalse>
2575 {
using type = _Iffalse; };
2578 template<
typename... _Tp>
2590 template<
typename _Tp>
2591 struct __success_type
2592 {
using type = _Tp; };
2594 struct __failure_type
2597 struct __do_common_type_impl
2599 template<
typename _Tp,
typename _Up>
2605 template<
typename _Tp,
typename _Up>
2606 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2609#if __cplusplus > 201703L
2612 template<
typename _Tp,
typename _Up>
2613 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2617 template<
typename,
typename>
2618 static __failure_type
2621 template<
typename _Tp,
typename _Up>
2622 static decltype(_S_test_2<_Tp, _Up>(0))
2632 template<
typename _Tp0>
2638 template<
typename _Tp1,
typename _Tp2,
2639 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2640 struct __common_type_impl
2644 using type = common_type<_Dp1, _Dp2>;
2647 template<
typename _Tp1,
typename _Tp2>
2648 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2649 :
private __do_common_type_impl
2653 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2657 template<
typename _Tp1,
typename _Tp2>
2659 :
public __common_type_impl<_Tp1, _Tp2>::type
2662 template<
typename...>
2663 struct __common_type_pack
2666 template<
typename,
typename,
typename =
void>
2667 struct __common_type_fold;
2670 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2672 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2673 __common_type_pack<_Rp...>>
2679 template<
typename _CTp,
typename... _Rp>
2680 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2681 __void_t<typename _CTp::type>>
2686 template<
typename _CTp,
typename _Rp>
2687 struct __common_type_fold<_CTp, _Rp, void>
2690 template<
typename _Tp,
bool = __is_enum(_Tp)>
2691 struct __underlying_type_impl
2693 using type = __underlying_type(_Tp);
2696 template<
typename _Tp>
2697 struct __underlying_type_impl<_Tp, false>
2702 template<
typename _Tp>
2704 :
public __underlying_type_impl<_Tp>
2708 template<
typename _Tp>
2709 struct __declval_protector
2711 static const bool __stop =
false;
2719 template<
typename _Tp>
2720 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2722 static_assert(__declval_protector<_Tp>::__stop,
2723 "declval() must not be used!");
2724 return __declval<_Tp>(0);
2728 template<
typename _Signature>
2734 struct __invoke_memfun_ref { };
2735 struct __invoke_memfun_deref { };
2736 struct __invoke_memobj_ref { };
2737 struct __invoke_memobj_deref { };
2738 struct __invoke_other { };
2741 template<
typename _Tp,
typename _Tag>
2742 struct __result_of_success : __success_type<_Tp>
2743 {
using __invoke_type = _Tag; };
2746 struct __result_of_memfun_ref_impl
2748 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2749 static __result_of_success<
decltype(
2751 ), __invoke_memfun_ref> _S_test(
int);
2753 template<
typename...>
2754 static __failure_type _S_test(...);
2757 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2758 struct __result_of_memfun_ref
2759 :
private __result_of_memfun_ref_impl
2761 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2765 struct __result_of_memfun_deref_impl
2767 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2768 static __result_of_success<
decltype(
2770 ), __invoke_memfun_deref> _S_test(
int);
2772 template<
typename...>
2773 static __failure_type _S_test(...);
2776 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2777 struct __result_of_memfun_deref
2778 :
private __result_of_memfun_deref_impl
2780 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2784 struct __result_of_memobj_ref_impl
2786 template<
typename _Fp,
typename _Tp1>
2787 static __result_of_success<
decltype(
2789 ), __invoke_memobj_ref> _S_test(
int);
2791 template<
typename,
typename>
2792 static __failure_type _S_test(...);
2795 template<
typename _MemPtr,
typename _Arg>
2796 struct __result_of_memobj_ref
2797 :
private __result_of_memobj_ref_impl
2799 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2803 struct __result_of_memobj_deref_impl
2805 template<
typename _Fp,
typename _Tp1>
2806 static __result_of_success<
decltype(
2808 ), __invoke_memobj_deref> _S_test(
int);
2810 template<
typename,
typename>
2811 static __failure_type _S_test(...);
2814 template<
typename _MemPtr,
typename _Arg>
2815 struct __result_of_memobj_deref
2816 :
private __result_of_memobj_deref_impl
2818 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2821 template<
typename _MemPtr,
typename _Arg>
2822 struct __result_of_memobj;
2824 template<
typename _Res,
typename _Class,
typename _Arg>
2825 struct __result_of_memobj<_Res _Class::*, _Arg>
2827 using _Argval = __remove_cvref_t<_Arg>;
2828 using _MemPtr = _Res _Class::*;
2829 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2830 is_base_of<_Class, _Argval>>::value,
2831 __result_of_memobj_ref<_MemPtr, _Arg>,
2832 __result_of_memobj_deref<_MemPtr, _Arg>
2836 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2837 struct __result_of_memfun;
2839 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2840 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2842 using _Argval =
typename remove_reference<_Arg>::type;
2843 using _MemPtr = _Res _Class::*;
2844 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2845 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2846 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2855 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2861 template<
typename _Tp,
typename _Up>
2867 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2868 struct __result_of_impl
2870 using type = __failure_type;
2873 template<
typename _MemPtr,
typename _Arg>
2874 struct __result_of_impl<true, false, _MemPtr, _Arg>
2875 :
public __result_of_memobj<__decay_t<_MemPtr>,
2876 typename __inv_unwrap<_Arg>::type>
2879 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2880 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2881 :
public __result_of_memfun<__decay_t<_MemPtr>,
2882 typename __inv_unwrap<_Arg>::type, _Args...>
2886 struct __result_of_other_impl
2888 template<
typename _Fn,
typename... _Args>
2889 static __result_of_success<
decltype(
2891 ), __invoke_other> _S_test(
int);
2893 template<
typename...>
2894 static __failure_type _S_test(...);
2897 template<
typename _Functor,
typename... _ArgTypes>
2898 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2899 :
private __result_of_other_impl
2901 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2905 template<
typename _Functor,
typename... _ArgTypes>
2906 struct __invoke_result
2907 :
public __result_of_impl<
2908 is_member_object_pointer<
2909 typename remove_reference<_Functor>::type
2911 is_member_function_pointer<
2912 typename remove_reference<_Functor>::type
2914 _Functor, _ArgTypes...
2919 template<
typename _Fn,
typename... _Args>
2920 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2923 template<
typename _Functor,
typename... _ArgTypes>
2924 struct result_of<_Functor(_ArgTypes...)>
2925 :
public __invoke_result<_Functor, _ArgTypes...>
2926 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2928#if __cplusplus >= 201402L
2929#pragma GCC diagnostic push
2930#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2932 template<
size_t _Len,
2933 size_t _Align = __aligned_storage_default_alignment(_Len)>
2934 using aligned_storage_t _GLIBCXX23_DEPRECATED =
typename aligned_storage<_Len, _Align>::type;
2936 template <
size_t _Len,
typename... _Types>
2937 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2938#pragma GCC diagnostic pop
2941 template<
typename _Tp>
2942 using decay_t =
typename decay<_Tp>::type;
2945 template<
bool _Cond,
typename _Tp =
void>
2949 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2950 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2953 template<
typename... _Tp>
2957 template<
typename _Tp>
2961 template<
typename _Tp>
2965#ifdef __cpp_lib_void_t
2967 template<typename...> using void_t = void;
2977 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2978 struct __detected_or
2985 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2986 requires requires {
typename _Op<_Args...>; }
2987 struct __detected_or<_Def, _Op, _Args...>
2989 using type = _Op<_Args...>;
2994 template<
typename _Default,
typename _AlwaysVoid,
2995 template<
typename...>
class _Op,
typename... _Args>
2998 using type = _Default;
3003 template<
typename _Default,
template<
typename...>
class _Op,
3005 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
3007 using type = _Op<_Args...>;
3011 template<
typename _Default,
template<
typename...>
class _Op,
3013 using __detected_or = __detector<_Default, void, _Op, _Args...>;
3017 template<
typename _Default,
template<
typename...>
class _Op,
3019 using __detected_or_t
3020 =
typename __detected_or<_Default, _Op, _Args...>::type;
3026#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
3027 template<typename _Tp, typename = __void_t<>> \
3028 struct __has_##_NTYPE \
3031 template<typename _Tp> \
3032 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
3036 template <
typename _Tp>
3037 struct __is_swappable;
3039 template <
typename _Tp>
3040 struct __is_nothrow_swappable;
3047 template<
typename _Tp>
3048 struct __is_tuple_like
3049 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
3053 template<
typename _Tp>
3054 _GLIBCXX20_CONSTEXPR
3056 _Require<__not_<__is_tuple_like<_Tp>>,
3060 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
3063 template<
typename _Tp,
size_t _Nm>
3064 _GLIBCXX20_CONSTEXPR
3066 __enable_if_t<__is_swappable<_Tp>::value>
3067 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
3068 noexcept(__is_nothrow_swappable<_Tp>::value);
3071 namespace __swappable_details {
3074 struct __do_is_swappable_impl
3076 template<
typename _Tp,
typename
3078 static true_type __test(
int);
3084 struct __do_is_nothrow_swappable_impl
3086 template<
typename _Tp>
3087 static __bool_constant<
3097 template<
typename _Tp>
3098 struct __is_swappable_impl
3099 :
public __swappable_details::__do_is_swappable_impl
3101 using type =
decltype(__test<_Tp>(0));
3104 template<
typename _Tp>
3105 struct __is_nothrow_swappable_impl
3106 :
public __swappable_details::__do_is_nothrow_swappable_impl
3108 using type =
decltype(__test<_Tp>(0));
3111 template<
typename _Tp>
3112 struct __is_swappable
3113 :
public __is_swappable_impl<_Tp>::type
3116 template<
typename _Tp>
3117 struct __is_nothrow_swappable
3118 :
public __is_nothrow_swappable_impl<_Tp>::type
3122#ifdef __cpp_lib_is_swappable
3126 template<
typename _Tp>
3128 :
public __is_swappable_impl<_Tp>::type
3130 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3131 "template argument must be a complete class or an unbounded array");
3135 template<
typename _Tp>
3136 struct is_nothrow_swappable
3137 :
public __is_nothrow_swappable_impl<_Tp>::type
3139 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3140 "template argument must be a complete class or an unbounded array");
3143#if __cplusplus >= 201402L
3145 template<
typename _Tp>
3146 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
3147 is_swappable<_Tp>::value;
3150 template<
typename _Tp>
3151 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
3152 is_nothrow_swappable<_Tp>::value;
3156 namespace __swappable_with_details {
3159 struct __do_is_swappable_with_impl
3161 template<
typename _Tp,
typename _Up,
typename
3167 template<
typename,
typename>
3171 struct __do_is_nothrow_swappable_with_impl
3173 template<
typename _Tp,
typename _Up>
3174 static __bool_constant<
3180 template<
typename,
typename>
3186 template<
typename _Tp,
typename _Up>
3187 struct __is_swappable_with_impl
3188 :
public __swappable_with_details::__do_is_swappable_with_impl
3190 using type =
decltype(__test<_Tp, _Up>(0));
3194 template<
typename _Tp>
3195 struct __is_swappable_with_impl<_Tp&, _Tp&>
3196 :
public __swappable_details::__do_is_swappable_impl
3198 using type =
decltype(__test<_Tp&>(0));
3201 template<
typename _Tp,
typename _Up>
3202 struct __is_nothrow_swappable_with_impl
3203 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
3205 using type =
decltype(__test<_Tp, _Up>(0));
3209 template<
typename _Tp>
3210 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
3211 :
public __swappable_details::__do_is_nothrow_swappable_impl
3213 using type =
decltype(__test<_Tp&>(0));
3218 template<
typename _Tp,
typename _Up>
3219 struct is_swappable_with
3220 :
public __is_swappable_with_impl<_Tp, _Up>::type
3222 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3223 "first template argument must be a complete class or an unbounded array");
3224 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3225 "second template argument must be a complete class or an unbounded array");
3229 template<
typename _Tp,
typename _Up>
3230 struct is_nothrow_swappable_with
3231 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
3233 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3234 "first template argument must be a complete class or an unbounded array");
3235 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3236 "second template argument must be a complete class or an unbounded array");
3239#if __cplusplus >= 201402L
3241 template<
typename _Tp,
typename _Up>
3242 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3243 is_swappable_with<_Tp, _Up>::value;
3246 template<
typename _Tp,
typename _Up>
3247 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3248 is_nothrow_swappable_with<_Tp, _Up>::value;
3258 template<
typename _Result,
typename _Ret,
3260 struct __is_invocable_impl
3267 template<
typename _Result,
typename _Ret>
3268 struct __is_invocable_impl<_Result, _Ret,
3270 __void_t<typename _Result::type>>
3276#pragma GCC diagnostic push
3277#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3279 template<
typename _Result,
typename _Ret>
3280 struct __is_invocable_impl<_Result, _Ret,
3282 __void_t<typename _Result::type>>
3286 using _Res_t =
typename _Result::type;
3290 static _Res_t _S_get() noexcept;
3293 template<typename _Tp>
3294 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3297 template<typename _Tp,
3298 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3299 typename = decltype(_S_conv<_Tp>(_S_get())),
3300#if __has_builtin(__reference_converts_from_temporary)
3301 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3303 bool _Dangle =
false
3306 static __bool_constant<_Nothrow && !_Dangle>
3309 template<
typename _Tp,
bool = false>
3315 using type =
decltype(_S_test<_Ret,
true>(1));
3318 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3320#pragma GCC diagnostic pop
3322 template<
typename _Fn,
typename... _ArgTypes>
3323 struct __is_invocable
3324#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3325 : __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3327 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3331 template<
typename _Fn,
typename _Tp,
typename... _Args>
3332 constexpr bool __call_is_nt(__invoke_memfun_ref)
3334 using _Up =
typename __inv_unwrap<_Tp>::type;
3339 template<
typename _Fn,
typename _Tp,
typename... _Args>
3340 constexpr bool __call_is_nt(__invoke_memfun_deref)
3346 template<
typename _Fn,
typename _Tp>
3347 constexpr bool __call_is_nt(__invoke_memobj_ref)
3349 using _Up =
typename __inv_unwrap<_Tp>::type;
3353 template<
typename _Fn,
typename _Tp>
3354 constexpr bool __call_is_nt(__invoke_memobj_deref)
3359 template<
typename _Fn,
typename... _Args>
3360 constexpr bool __call_is_nt(__invoke_other)
3365 template<
typename _Result,
typename _Fn,
typename... _Args>
3366 struct __call_is_nothrow
3368 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3372 template<
typename _Fn,
typename... _Args>
3373 using __call_is_nothrow_
3374 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3377 template<
typename _Fn,
typename... _Args>
3378 struct __is_nothrow_invocable
3379#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3380 : __bool_constant<__is_nothrow_invocable(_Fn, _Args...)>
3382 : __and_<__is_invocable<_Fn, _Args...>,
3383 __call_is_nothrow_<_Fn, _Args...>>::type
3387#pragma GCC diagnostic push
3388#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3389 struct __nonesuchbase {};
3390 struct __nonesuch :
private __nonesuchbase {
3391 ~__nonesuch() =
delete;
3392 __nonesuch(__nonesuch
const&) =
delete;
3393 void operator=(__nonesuch
const&) =
delete;
3395#pragma GCC diagnostic pop
3398#ifdef __cpp_lib_is_invocable
3400 template<typename _Functor, typename... _ArgTypes>
3401 struct invoke_result
3402 :
public __invoke_result<_Functor, _ArgTypes...>
3404 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3405 "_Functor must be a complete class or an unbounded array");
3406 static_assert((std::__is_complete_or_unbounded(
3407 __type_identity<_ArgTypes>{}) && ...),
3408 "each argument type must be a complete class or an unbounded array");
3412 template<
typename _Fn,
typename... _Args>
3413 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3416 template<
typename _Fn,
typename... _ArgTypes>
3418#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3419 :
public __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3421 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3424 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3425 "_Fn must be a complete class or an unbounded array");
3426 static_assert((std::__is_complete_or_unbounded(
3427 __type_identity<_ArgTypes>{}) && ...),
3428 "each argument type must be a complete class or an unbounded array");
3432 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3433 struct is_invocable_r
3434 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3436 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3437 "_Fn must be a complete class or an unbounded array");
3438 static_assert((std::__is_complete_or_unbounded(
3439 __type_identity<_ArgTypes>{}) && ...),
3440 "each argument type must be a complete class or an unbounded array");
3441 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3442 "_Ret must be a complete class or an unbounded array");
3446 template<
typename _Fn,
typename... _ArgTypes>
3447 struct is_nothrow_invocable
3448#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3449 :
public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)>
3451 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3452 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3455 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3456 "_Fn must be a complete class or an unbounded array");
3457 static_assert((std::__is_complete_or_unbounded(
3458 __type_identity<_ArgTypes>{}) && ...),
3459 "each argument type must be a complete class or an unbounded array");
3466 template<
typename _Result,
typename _Ret>
3467 using __is_nt_invocable_impl
3468 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3472 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3473 struct is_nothrow_invocable_r
3474 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3475 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3477 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3478 "_Fn must be a complete class or an unbounded array");
3479 static_assert((std::__is_complete_or_unbounded(
3480 __type_identity<_ArgTypes>{}) && ...),
3481 "each argument type must be a complete class or an unbounded array");
3482 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3483 "_Ret must be a complete class or an unbounded array");
3487#if __cpp_lib_type_trait_variable_templates
3502template <
typename _Tp>
3504template <
typename _Tp>
3505 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3506template <
typename _Tp>
3508template <
typename _Tp>
3511#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3512template <
typename _Tp>
3513 inline constexpr bool is_array_v = __is_array(_Tp);
3515template <
typename _Tp>
3516 inline constexpr bool is_array_v =
false;
3517template <
typename _Tp>
3518 inline constexpr bool is_array_v<_Tp[]> =
true;
3519template <
typename _Tp,
size_t _Num>
3520 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3523#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
3524template <
typename _Tp>
3525 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
3527template <
typename _Tp>
3528 inline constexpr bool is_pointer_v =
false;
3529template <
typename _Tp>
3530 inline constexpr bool is_pointer_v<_Tp*> =
true;
3531template <
typename _Tp>
3532 inline constexpr bool is_pointer_v<_Tp* const> =
true;
3533template <
typename _Tp>
3534 inline constexpr bool is_pointer_v<_Tp* volatile> =
true;
3535template <
typename _Tp>
3536 inline constexpr bool is_pointer_v<_Tp* const volatile> =
true;
3539template <
typename _Tp>
3540 inline constexpr bool is_lvalue_reference_v =
false;
3541template <
typename _Tp>
3542 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3543template <
typename _Tp>
3544 inline constexpr bool is_rvalue_reference_v =
false;
3545template <
typename _Tp>
3546 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3548#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3549template <
typename _Tp>
3550 inline constexpr bool is_member_object_pointer_v =
3551 __is_member_object_pointer(_Tp);
3553template <
typename _Tp>
3554 inline constexpr bool is_member_object_pointer_v =
3558#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3559template <
typename _Tp>
3560 inline constexpr bool is_member_function_pointer_v =
3561 __is_member_function_pointer(_Tp);
3563template <
typename _Tp>
3564 inline constexpr bool is_member_function_pointer_v =
3568#if __cpp_impl_reflection >= 202506L
3569template <
typename _Tp>
3570 inline constexpr bool is_reflection_v =
false;
3572 inline constexpr bool is_reflection_v<
decltype(^^int)> =
true;
3574 inline constexpr bool is_reflection_v<
const decltype(^^int)> =
true;
3576 inline constexpr bool is_reflection_v<
volatile decltype(^^int)> =
true;
3578 inline constexpr bool is_reflection_v<
const volatile decltype(^^int)> =
true;
3581template <
typename _Tp>
3582 inline constexpr bool is_enum_v = __is_enum(_Tp);
3583template <
typename _Tp>
3584 inline constexpr bool is_union_v = __is_union(_Tp);
3585template <
typename _Tp>
3586 inline constexpr bool is_class_v = __is_class(_Tp);
3589#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3590template <
typename _Tp>
3591 inline constexpr bool is_reference_v = __is_reference(_Tp);
3593template <
typename _Tp>
3594 inline constexpr bool is_reference_v =
false;
3595template <
typename _Tp>
3596 inline constexpr bool is_reference_v<_Tp&> =
true;
3597template <
typename _Tp>
3598 inline constexpr bool is_reference_v<_Tp&&> =
true;
3601template <
typename _Tp>
3603template <
typename _Tp>
3606#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3607template <
typename _Tp>
3608 inline constexpr bool is_object_v = __is_object(_Tp);
3610template <
typename _Tp>
3614template <
typename _Tp>
3616template <
typename _Tp>
3617 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3619#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3620template <
typename _Tp>
3621 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3623template <
typename _Tp>
3627#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
3628template <
typename _Tp>
3629 inline constexpr bool is_const_v = __is_const(_Tp);
3631template <
typename _Tp>
3632 inline constexpr bool is_const_v =
false;
3633template <
typename _Tp>
3634 inline constexpr bool is_const_v<const _Tp> =
true;
3637#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3638template <
typename _Tp>
3639 inline constexpr bool is_function_v = __is_function(_Tp);
3641template <
typename _Tp>
3642 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3643template <
typename _Tp>
3644 inline constexpr bool is_function_v<_Tp&> =
false;
3645template <
typename _Tp>
3646 inline constexpr bool is_function_v<_Tp&&> =
false;
3649#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
3650template <
typename _Tp>
3651 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
3653template <
typename _Tp>
3654 inline constexpr bool is_volatile_v =
false;
3655template <
typename _Tp>
3656 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3659template <
typename _Tp>
3660 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible_v && is_trivially_copyable_v")
3661 inline constexpr
bool is_trivial_v = __is_trivial(_Tp);
3662template <typename _Tp>
3663 inline constexpr
bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3664template <typename _Tp>
3665 inline constexpr
bool is_standard_layout_v = __is_standard_layout(_Tp);
3666template <typename _Tp>
3667 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3668 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3669template <typename _Tp>
3670 _GLIBCXX17_DEPRECATED
3671 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3672template <typename _Tp>
3673 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3674template <typename _Tp>
3675 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3676template <typename _Tp>
3677 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3678template <typename _Tp>
3679 inline constexpr
bool is_final_v = __is_final(_Tp);
3681template <typename _Tp>
3682 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3683template <typename _Tp>
3684 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3686template <typename _Tp, typename... _Args>
3687 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3688template <typename _Tp>
3689 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3690template <typename _Tp>
3691 inline constexpr
bool is_copy_constructible_v
3692 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3693template <typename _Tp>
3694 inline constexpr
bool is_move_constructible_v
3695 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3697template <typename _Tp, typename _Up>
3698 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3699template <typename _Tp>
3700 inline constexpr
bool is_copy_assignable_v
3701 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3702template <typename _Tp>
3703 inline constexpr
bool is_move_assignable_v
3704 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3706#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
3707template <
typename _Tp>
3708 inline constexpr bool is_destructible_v = __is_destructible(_Tp);
3710template <
typename _Tp>
3714template <
typename _Tp,
typename... _Args>
3715 inline constexpr bool is_trivially_constructible_v
3716 = __is_trivially_constructible(_Tp, _Args...);
3717template <
typename _Tp>
3718 inline constexpr bool is_trivially_default_constructible_v
3719 = __is_trivially_constructible(_Tp);
3720template <
typename _Tp>
3721 inline constexpr bool is_trivially_copy_constructible_v
3722 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3723template <
typename _Tp>
3724 inline constexpr bool is_trivially_move_constructible_v
3725 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3727template <
typename _Tp,
typename _Up>
3728 inline constexpr bool is_trivially_assignable_v
3729 = __is_trivially_assignable(_Tp, _Up);
3730template <
typename _Tp>
3731 inline constexpr bool is_trivially_copy_assignable_v
3732 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3733 __add_lval_ref_t<const _Tp>);
3734template <
typename _Tp>
3735 inline constexpr bool is_trivially_move_assignable_v
3736 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3737 __add_rval_ref_t<_Tp>);
3739#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
3740template <
typename _Tp>
3741 inline constexpr bool is_trivially_destructible_v
3742 = __is_trivially_destructible(_Tp);
3744template <
typename _Tp>
3745 inline constexpr bool is_trivially_destructible_v =
false;
3747template <
typename _Tp>
3748 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3749 inline constexpr bool is_trivially_destructible_v<_Tp>
3750 = __has_trivial_destructor(_Tp);
3751template <
typename _Tp>
3752 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3753template <
typename _Tp>
3754 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3755template <
typename _Tp,
size_t _Nm>
3756 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3757 = is_trivially_destructible_v<_Tp>;
3759template <
typename _Tp>
3760 inline constexpr bool is_trivially_destructible_v =
3764template <
typename _Tp,
typename... _Args>
3765 inline constexpr bool is_nothrow_constructible_v
3766 = __is_nothrow_constructible(_Tp, _Args...);
3767template <
typename _Tp>
3768 inline constexpr bool is_nothrow_default_constructible_v
3769 = __is_nothrow_constructible(_Tp);
3770template <
typename _Tp>
3771 inline constexpr bool is_nothrow_copy_constructible_v
3772 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3773template <
typename _Tp>
3774 inline constexpr bool is_nothrow_move_constructible_v
3775 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3777template <
typename _Tp,
typename _Up>
3778 inline constexpr bool is_nothrow_assignable_v
3779 = __is_nothrow_assignable(_Tp, _Up);
3780template <
typename _Tp>
3781 inline constexpr bool is_nothrow_copy_assignable_v
3782 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3783 __add_lval_ref_t<const _Tp>);
3784template <
typename _Tp>
3785 inline constexpr bool is_nothrow_move_assignable_v
3786 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3788#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
3789template <
typename _Tp>
3790 inline constexpr bool is_nothrow_destructible_v
3791 = __is_nothrow_destructible(_Tp);
3793template <
typename _Tp>
3794 inline constexpr bool is_nothrow_destructible_v =
3798template <
typename _Tp>
3799 inline constexpr bool has_virtual_destructor_v
3800 = __has_virtual_destructor(_Tp);
3802template <
typename _Tp>
3803 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3805#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
3806 && (!defined(__clang__) || __clang_major__ >= 20)
3807template <
typename _Tp>
3808 inline constexpr size_t rank_v = __array_rank(_Tp);
3810template <
typename _Tp>
3811 inline constexpr size_t rank_v = 0;
3812template <
typename _Tp,
size_t _Size>
3813 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3814template <
typename _Tp>
3815 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3818template <
typename _Tp,
unsigned _Idx = 0>
3819 inline constexpr size_t extent_v = 0;
3820template <
typename _Tp,
size_t _Size>
3821 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3822template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3823 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3824template <
typename _Tp>
3825 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3826template <
typename _Tp,
unsigned _Idx>
3827 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3829#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3830template <
typename _Tp,
typename _Up>
3831 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3833template <
typename _Tp,
typename _Up>
3834 inline constexpr bool is_same_v =
false;
3835template <
typename _Tp>
3836 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3838template <
typename _Base,
typename _Derived>
3839 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3840#ifdef __cpp_lib_is_virtual_base_of
3841template <
typename _Base,
typename _Derived>
3842 inline constexpr bool is_virtual_base_of_v = __builtin_is_virtual_base_of(_Base, _Derived);
3844#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3845template <
typename _From,
typename _To>
3846 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3848template <
typename _From,
typename _To>
3849 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3851template<
typename _Fn,
typename... _Args>
3852 inline constexpr bool is_invocable_v
3853#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3854 = __is_invocable(_Fn, _Args...);
3856 = is_invocable<_Fn, _Args...>::value;
3858template<
typename _Fn,
typename... _Args>
3859 inline constexpr bool is_nothrow_invocable_v
3860#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3861 = __is_nothrow_invocable(_Fn, _Args...);
3863 = is_nothrow_invocable<_Fn, _Args...>::value;
3865template<
typename _Ret,
typename _Fn,
typename... _Args>
3866 inline constexpr bool is_invocable_r_v
3867 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3868template<
typename _Ret,
typename _Fn,
typename... _Args>
3869 inline constexpr bool is_nothrow_invocable_r_v
3870 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3874#ifdef __cpp_lib_has_unique_object_representations
3877 template<typename _Tp>
3878 struct has_unique_object_representations
3879 : bool_constant<__has_unique_object_representations(
3880 remove_cv_t<remove_all_extents_t<_Tp>>
3883 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3884 "template argument must be a complete class or an unbounded array");
3887# if __cpp_lib_type_trait_variable_templates
3889 template<typename _Tp>
3890 inline constexpr bool has_unique_object_representations_v
3891 = has_unique_object_representations<_Tp>::value;
3895#ifdef __cpp_lib_is_aggregate
3898 template<typename _Tp>
3900 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3903# if __cpp_lib_type_trait_variable_templates
3908 template<
typename _Tp>
3909 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3913#if __cpp_lib_is_structural >= 202603L
3916 template<typename _Tp>
3917 struct is_structural
3918 : bool_constant<__builtin_is_structural(_Tp)>
3925 template<
typename _Tp>
3926 inline constexpr bool is_structural_v
3927 = __builtin_is_structural(_Tp);
3934#ifdef __cpp_lib_remove_cvref
3935# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3936 template<
typename _Tp>
3938 {
using type = __remove_cvref(_Tp); };
3940 template<
typename _Tp>
3942 {
using type =
typename remove_cv<_Tp>::type; };
3944 template<
typename _Tp>
3945 struct remove_cvref<_Tp&>
3946 {
using type =
typename remove_cv<_Tp>::type; };
3948 template<
typename _Tp>
3949 struct remove_cvref<_Tp&&>
3950 {
using type =
typename remove_cv<_Tp>::type; };
3953 template<
typename _Tp>
3954 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3958#ifdef __cpp_lib_type_identity
3963 template<
typename _Tp>
3964 struct type_identity {
using type = _Tp; };
3966 template<
typename _Tp>
3967 using type_identity_t =
typename type_identity<_Tp>::type;
3971#ifdef __cpp_lib_unwrap_ref
3976 template<
typename _Tp>
3977 struct unwrap_reference {
using type = _Tp; };
3979 template<
typename _Tp>
3982 template<
typename _Tp>
3983 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3990 template<
typename _Tp>
3991 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3993 template<
typename _Tp>
3994 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3998#ifdef __cpp_lib_bounded_array_traits
4002# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
4003 template<
typename _Tp>
4004 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
4006 template<
typename _Tp>
4007 inline constexpr bool is_bounded_array_v =
false;
4009 template<
typename _Tp,
size_t _Size>
4010 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
4016# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
4017 template<
typename _Tp>
4018 inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
4020 template<
typename _Tp>
4021 inline constexpr bool is_unbounded_array_v =
false;
4023 template<
typename _Tp>
4024 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
4029 template<
typename _Tp>
4030 struct is_bounded_array
4031 :
public bool_constant<is_bounded_array_v<_Tp>>
4036 template<
typename _Tp>
4037 struct is_unbounded_array
4038 :
public bool_constant<is_unbounded_array_v<_Tp>>
4042#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
4045 template<
typename _Tp,
typename _Up>
4047 : bool_constant<__is_layout_compatible(_Tp, _Up)>
4052 template<
typename _Tp,
typename _Up>
4054 = __is_layout_compatible(_Tp, _Up);
4056#if __has_builtin(__builtin_is_corresponding_member)
4057# ifndef __cpp_lib_is_layout_compatible
4058# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
4062 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
4065 {
return __builtin_is_corresponding_member(__m1, __m2); }
4069#if __has_builtin(__is_pointer_interconvertible_base_of) \
4070 && __cplusplus >= 202002L
4073 template<
typename _Base,
typename _Derived>
4075 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
4080 template<
typename _Base,
typename _Derived>
4082 = __is_pointer_interconvertible_base_of(_Base, _Derived);
4084#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
4085# ifndef __cpp_lib_is_pointer_interconvertible
4086# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
4092 template<
typename _Tp,
typename _Mem>
4095 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
4099#ifdef __cpp_lib_is_scoped_enum
4103# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4104 template<
typename _Tp>
4105 struct is_scoped_enum
4106 : bool_constant<__is_scoped_enum(_Tp)>
4109 template<
typename _Tp>
4110 struct is_scoped_enum
4114 template<
typename _Tp>
4115 requires __is_enum(_Tp)
4116 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
4117 struct is_scoped_enum<_Tp>
4118 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
4124# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4125 template<
typename _Tp>
4126 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
4128 template<
typename _Tp>
4129 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
4133#ifdef __cpp_lib_is_implicit_lifetime
4137 template<
typename _Tp>
4138 struct is_implicit_lifetime
4139 : bool_constant<__builtin_is_implicit_lifetime(_Tp)>
4144 template<
typename _Tp>
4145 inline constexpr bool is_implicit_lifetime_v
4146 = __builtin_is_implicit_lifetime(_Tp);
4149#ifdef __cpp_lib_reference_from_temporary
4154 template<typename _Tp, typename _Up>
4155 struct reference_constructs_from_temporary
4156 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
4158 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
4159 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
4160 "template argument must be a complete class or an unbounded array");
4167 template<
typename _Tp,
typename _Up>
4168 struct reference_converts_from_temporary
4169 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
4171 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
4172 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
4173 "template argument must be a complete class or an unbounded array");
4178 template<
typename _Tp,
typename _Up>
4179 inline constexpr bool reference_constructs_from_temporary_v
4180 = reference_constructs_from_temporary<_Tp, _Up>::value;
4184 template<
typename _Tp,
typename _Up>
4185 inline constexpr bool reference_converts_from_temporary_v
4186 = reference_converts_from_temporary<_Tp, _Up>::value;
4189#ifdef __cpp_lib_is_constant_evaluated
4192 [[__gnu__::__always_inline__]]
4194 is_constant_evaluated() noexcept
4196#if __cpp_if_consteval >= 202106L
4197 if consteval {
return true; }
else {
return false; }
4199 return __builtin_is_constant_evaluated();
4204#if __cplusplus >= 202002L
4206 template<
typename _From,
typename _To>
4207 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
4209 template<
typename _Xp,
typename _Yp>
4213 template<
typename _Ap,
typename _Bp,
typename =
void>
4214 struct __common_ref_impl
4218 template<
typename _Ap,
typename _Bp>
4219 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
4222 template<
typename _Xp,
typename _Yp>
4223 using __condres_cvref
4224 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
4227 template<
typename _Xp,
typename _Yp>
4228 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
4230 __condres_cvref<_Xp, _Yp>>
4234 template<
typename _Xp,
typename _Yp>
4238 template<
typename _Xp,
typename _Yp>
4239 struct __common_ref_impl<_Xp&&, _Yp&&,
4240 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
4241 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
4242 {
using type = __common_ref_C<_Xp, _Yp>; };
4245 template<
typename _Xp,
typename _Yp>
4246 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
4249 template<
typename _Xp,
typename _Yp>
4250 struct __common_ref_impl<_Xp&&, _Yp&,
4251 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
4252 {
using type = __common_ref_D<_Xp, _Yp>; };
4255 template<
typename _Xp,
typename _Yp>
4256 struct __common_ref_impl<_Xp&, _Yp&&>
4257 : __common_ref_impl<_Yp&&, _Xp&>
4261 template<
typename _Tp,
typename _Up,
4262 template<
typename>
class _TQual,
template<
typename>
class _UQual>
4263 struct basic_common_reference
4267 template<
typename _Tp>
4269 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
4271 template<
typename _Tp>
4273 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
4275 template<
typename _Tp>
4276 struct __xref<_Tp&&>
4277 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
4279 template<
typename _Tp1,
typename _Tp2>
4280 using __basic_common_ref
4281 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
4282 remove_cvref_t<_Tp2>,
4283 __xref<_Tp1>::template __type,
4284 __xref<_Tp2>::template __type>::type;
4287 template<
typename... _Tp>
4288 struct common_reference;
4290 template<
typename... _Tp>
4295 struct common_reference<>
4299 template<
typename _Tp0>
4300 struct common_reference<_Tp0>
4301 {
using type = _Tp0; };
4304 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1>
4305 struct __common_reference_impl
4306 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
4310 template<
typename _Tp1,
typename _Tp2>
4311 struct common_reference<_Tp1, _Tp2>
4312 : __common_reference_impl<_Tp1, _Tp2>
4316 template<
typename _Tp1,
typename _Tp2>
4317 requires is_reference_v<_Tp1> && is_reference_v<_Tp2>
4318 &&
requires {
typename __common_ref<_Tp1, _Tp2>; }
4319#if __cpp_lib_common_reference
4320 && is_convertible_v<add_pointer_t<_Tp1>,
4322 && is_convertible_v<add_pointer_t<_Tp2>,
4325 struct __common_reference_impl<_Tp1, _Tp2, 1>
4326 {
using type = __common_ref<_Tp1, _Tp2>; };
4329 template<
typename _Tp1,
typename _Tp2>
4330 requires requires {
typename __basic_common_ref<_Tp1, _Tp2>; }
4331 struct __common_reference_impl<_Tp1, _Tp2, 2>
4332 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
4335 template<
typename _Tp1,
typename _Tp2>
4336 requires requires {
typename __cond_res<_Tp1, _Tp2>; }
4337 struct __common_reference_impl<_Tp1, _Tp2, 3>
4338 {
using type = __cond_res<_Tp1, _Tp2>; };
4341 template<
typename _Tp1,
typename _Tp2>
4343 struct __common_reference_impl<_Tp1, _Tp2, 4>
4344 {
using type = common_type_t<_Tp1, _Tp2>; };
4347 template<
typename _Tp1,
typename _Tp2>
4348 struct __common_reference_impl<_Tp1, _Tp2, 5>
4352 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4353 struct common_reference<_Tp1, _Tp2, _Rest...>
4354 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4355 __common_type_pack<_Rest...>>
4359 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4360 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4361 __common_type_pack<_Rest...>,
4363 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4369#if __cplusplus >= 201103L
4372 template<
size_t... _Indexes>
struct _Index_tuple { };
4375 template<
size_t _Num>
4376 struct _Build_index_tuple
4378#if __has_builtin(__make_integer_seq)
4379 template<
typename,
size_t... _Indices>
4380 using _IdxTuple = _Index_tuple<_Indices...>;
4383 using __type = __make_integer_seq<_IdxTuple, size_t, _Num>;
4386 using __type = _Index_tuple<__integer_pack(_Num)...>;
4393_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.