29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
33#pragma GCC system_header
36#if __cplusplus < 201103L
42#define __glibcxx_want_apply
43#define __glibcxx_want_bool_constant
44#define __glibcxx_want_bounded_array_traits
45#define __glibcxx_want_common_reference
46#define __glibcxx_want_has_unique_object_representations
47#define __glibcxx_want_integral_constant_callable
48#define __glibcxx_want_is_aggregate
49#define __glibcxx_want_is_constant_evaluated
50#define __glibcxx_want_is_final
51#define __glibcxx_want_is_implicit_lifetime
52#define __glibcxx_want_is_invocable
53#define __glibcxx_want_is_layout_compatible
54#define __glibcxx_want_is_nothrow_convertible
55#define __glibcxx_want_is_null_pointer
56#define __glibcxx_want_is_pointer_interconvertible
57#define __glibcxx_want_is_scoped_enum
58#define __glibcxx_want_is_structural
59#define __glibcxx_want_is_swappable
60#define __glibcxx_want_is_virtual_base_of
61#define __glibcxx_want_logical_traits
62#define __glibcxx_want_reference_from_temporary
63#define __glibcxx_want_remove_cvref
64#define __glibcxx_want_result_of_sfinae
65#define __glibcxx_want_transformation_trait_aliases
66#define __glibcxx_want_type_identity
67#define __glibcxx_want_type_trait_variable_templates
68#define __glibcxx_want_unwrap_ref
69#define __glibcxx_want_void_t
70#define __glibcxx_want_within_lifetime
75namespace std _GLIBCXX_VISIBILITY(default)
77_GLIBCXX_BEGIN_NAMESPACE_VERSION
79 template<
typename _Tp>
96 template<
typename _Tp, _Tp __v>
99 static constexpr _Tp value = __v;
100 using value_type = _Tp;
102 constexpr operator value_type()
const noexcept {
return value; }
104#ifdef __cpp_lib_integral_constant_callable
105 constexpr value_type operator()()
const noexcept {
return value; }
109#if ! __cpp_inline_variables
110 template<
typename _Tp, _Tp __v>
111 constexpr _Tp integral_constant<_Tp, __v>::value;
126#ifdef __cpp_lib_bool_constant
130 using bool_constant = __bool_constant<__v>;
137 template<
bool,
typename _Tp =
void>
142 template<
typename _Tp>
144 {
using type = _Tp; };
147 template<
bool _Cond,
typename _Tp =
void>
148 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
153 template<
typename _Tp,
typename>
158 struct __conditional<false>
160 template<
typename,
typename _Up>
165 template<
bool _Cond,
typename _If,
typename _Else>
166 using __conditional_t
167 =
typename __conditional<_Cond>::template type<_If, _Else>;
169#ifdef __cpp_lib_type_identity
174 template<
typename _Tp>
175 struct type_identity {
using type = _Tp; };
177 template<
typename _Tp>
178 using type_identity_t =
typename type_identity<_Tp>::type;
182 template <
typename _Tp>
183 using __type_identity = type_identity<_Tp>;
185 template<
typename _Tp>
186 using __type_identity_t =
typename type_identity<_Tp>::type;
190 template <
typename _Type>
191 struct __type_identity
192 {
using type = _Type; };
194 template<
typename _Tp>
195 using __type_identity_t =
typename __type_identity<_Tp>::type;
203 template<
typename _Tp,
typename...>
204 using __first_t = _Tp;
207 template<
typename... _Bn>
209 __enable_if_t<!bool(_Bn::value)>...>;
211 template<
typename... _Bn>
214 template<
typename... _Bn>
215 auto __and_fn(
int) -> __first_t<
true_type,
216 __enable_if_t<bool(_Bn::value)>...>;
218 template<
typename... _Bn>
225 template<
typename... _Bn>
227 : decltype(__detail::__or_fn<_Bn...>(0))
230 template<
typename... _Bn>
232 : decltype(__detail::__and_fn<_Bn...>(0))
235 template<
typename _Pp>
237 : __bool_constant<!bool(_Pp::value)>
241#ifdef __cpp_lib_logical_traits
244 template<
typename... _Bn>
245 inline constexpr bool __or_v = __or_<_Bn...>::value;
246 template<
typename... _Bn>
247 inline constexpr bool __and_v = __and_<_Bn...>::value;
251 template<
typename ,
typename _B1,
typename... _Bn>
252 struct __disjunction_impl
253 {
using type = _B1; };
255 template<
typename _B1,
typename _B2,
typename... _Bn>
256 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
257 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
259 template<
typename ,
typename _B1,
typename... _Bn>
260 struct __conjunction_impl
261 {
using type = _B1; };
263 template<
typename _B1,
typename _B2,
typename... _Bn>
264 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
265 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
269 template<
typename... _Bn>
271 : __detail::__conjunction_impl<void, _Bn...>::type
279 template<
typename... _Bn>
281 : __detail::__disjunction_impl<void, _Bn...>::type
289 template<
typename _Pp>
297 template<
typename... _Bn>
298 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
300 template<
typename... _Bn>
301 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
303 template<
typename _Pp>
304 inline constexpr bool negation_v = negation<_Pp>::value;
319 struct __is_array_unknown_bounds;
324 template<
typename _Tp>
325 using __maybe_complete_object_type
326 = __and_<is_object<_Tp>, __not_<__is_array_unknown_bounds<_Tp>>>;
332 template<
typename _Tp,
333 typename = __enable_if_t<__maybe_complete_object_type<_Tp>::value>,
334 size_t =
sizeof(_Tp)>
336 __is_complete_or_unbounded(__type_identity<_Tp>)
341 template<
typename _TypeIdentity,
342 typename _NestedType =
typename _TypeIdentity::type>
343 constexpr typename __not_<__maybe_complete_object_type<_NestedType>>::type
344 __is_complete_or_unbounded(_TypeIdentity)
348 template<
typename _Tp>
349 using __remove_cv_t =
typename remove_cv<_Tp>::type;
355 template<
typename _Tp>
364 struct is_void<const void>
365 :
public true_type { };
372 struct is_void<const volatile void>
381 enum class _Integer_kind { _None, _Signed, _Unsigned };
384 struct __is_integral_helper
386 {
static constexpr auto _S_kind = _Integer_kind::_None; };
389 struct __is_integral_helper<bool>
391 {
static constexpr auto _S_kind = _Integer_kind::_None; };
394 struct __is_integral_helper<char>
396 {
static constexpr auto _S_kind = _Integer_kind::_None; };
399 struct __is_integral_helper<signed char>
401 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
404 struct __is_integral_helper<unsigned char>
406 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
412 struct __is_integral_helper<wchar_t>
414 {
static constexpr auto _S_kind = _Integer_kind::_None; };
416#ifdef _GLIBCXX_USE_CHAR8_T
418 struct __is_integral_helper<char8_t>
420 {
static constexpr auto _S_kind = _Integer_kind::_None; };
424 struct __is_integral_helper<char16_t>
426 {
static constexpr auto _S_kind = _Integer_kind::_None; };
429 struct __is_integral_helper<char32_t>
431 {
static constexpr auto _S_kind = _Integer_kind::_None; };
434 struct __is_integral_helper<short>
436 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
439 struct __is_integral_helper<unsigned short>
441 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
444 struct __is_integral_helper<int>
446 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
449 struct __is_integral_helper<unsigned int>
451 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
454 struct __is_integral_helper<long>
456 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
459 struct __is_integral_helper<unsigned long>
461 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
464 struct __is_integral_helper<long long>
466 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
469 struct __is_integral_helper<unsigned long long>
471 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
475#if defined(__GLIBCXX_TYPE_INT_N_0)
478 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
480 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
484 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
486 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
488#if defined(__GLIBCXX_TYPE_INT_N_1)
491 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
493 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
497 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
499 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
501#if defined(__GLIBCXX_TYPE_INT_N_2)
504 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
506 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
510 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
512 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
514#if defined(__GLIBCXX_TYPE_INT_N_3)
517 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
519 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
523 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
525 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
528#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
531 struct __is_integral_helper<__int128>
533 {
static constexpr auto _S_kind = _Integer_kind::_Signed; };
537 struct __is_integral_helper<unsigned __int128>
539 {
static constexpr auto _S_kind = _Integer_kind::_Unsigned; };
543 template<
typename _Tp>
544 using __is_signed_integer
545 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
546 == _Integer_kind::_Signed>;
549 template<
typename _Tp>
550 using __is_unsigned_integer
551 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
552 == _Integer_kind::_Unsigned>;
556 template<
typename _Tp>
557 using __is_signed_or_unsigned_integer
558 = __bool_constant<__is_integral_helper<_Tp>::_S_kind
559 != _Integer_kind::_None>;
564 template<
typename _Tp>
566 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
571 struct __is_floating_point_helper
575 struct __is_floating_point_helper<float>
576 :
public true_type { };
579 struct __is_floating_point_helper<double>
583 struct __is_floating_point_helper<long double>
586#ifdef __STDCPP_FLOAT16_T__
588 struct __is_floating_point_helper<_Float16>
592#ifdef __STDCPP_FLOAT32_T__
594 struct __is_floating_point_helper<_Float32>
598#ifdef __STDCPP_FLOAT64_T__
600 struct __is_floating_point_helper<_Float64>
604#ifdef __STDCPP_FLOAT128_T__
606 struct __is_floating_point_helper<_Float128>
610#ifdef __STDCPP_BFLOAT16_T__
612 struct __is_floating_point_helper<__gnu_cxx::__bfloat16_t>
616#if defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
618 struct __is_floating_point_helper<__float128>
624 template<
typename _Tp>
626 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
630#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
631 template<
typename _Tp>
633 :
public __bool_constant<__is_array(_Tp)>
640 template<
typename _Tp, std::
size_t _Size>
641 struct is_array<_Tp[_Size]>
642 :
public true_type { };
644 template<
typename _Tp>
650#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
651 template<
typename _Tp>
653 :
public __bool_constant<__is_pointer(_Tp)>
656 template<
typename _Tp>
660 template<
typename _Tp>
661 struct is_pointer<_Tp*>
662 :
public true_type { };
664 template<
typename _Tp>
668 template<
typename _Tp>
672 template<
typename _Tp>
682 template<
typename _Tp>
691 template<
typename _Tp>
696#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
697 template<
typename _Tp>
699 :
public __bool_constant<__is_member_object_pointer(_Tp)>
702 template<
typename _Tp>
706 struct __is_member_object_pointer_helper
709 template<
typename _Tp,
typename _Cp>
710 struct __is_member_object_pointer_helper<_Tp _Cp::*>
711 :
public __not_<is_function<_Tp>>::type { };
714 template<
typename _Tp>
716 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
720#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
722 template<
typename _Tp>
724 :
public __bool_constant<__is_member_function_pointer(_Tp)>
727 template<
typename _Tp>
731 struct __is_member_function_pointer_helper
734 template<
typename _Tp,
typename _Cp>
735 struct __is_member_function_pointer_helper<_Tp _Cp::*>
736 :
public is_function<_Tp>::type { };
739 template<
typename _Tp>
741 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
746 template<
typename _Tp>
748 :
public __bool_constant<__is_enum(_Tp)>
752 template<
typename _Tp>
754 :
public __bool_constant<__is_union(_Tp)>
758 template<
typename _Tp>
760 :
public __bool_constant<__is_class(_Tp)>
764#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
765 template<
typename _Tp>
767 :
public __bool_constant<__is_function(_Tp)>
770 template<
typename _Tp>
772 :
public __bool_constant<!is_const<const _Tp>::value> { };
774 template<
typename _Tp>
775 struct is_function<_Tp&>
776 :
public false_type { };
778 template<
typename _Tp>
783#if __cpp_impl_reflection >= 202506L
785 template<typename _Tp>
790 struct is_reflection<decltype(^^int)>
794 struct is_reflection<const decltype(^^int)>
798 struct is_reflection<volatile decltype(^^int)>
802 struct is_reflection<const volatile decltype(^^int)>
806#ifdef __cpp_lib_is_null_pointer
808 template<typename _Tp>
809 struct is_null_pointer
813 struct is_null_pointer<std::nullptr_t>
817 struct is_null_pointer<const std::nullptr_t>
821 struct is_null_pointer<volatile std::nullptr_t>
825 struct is_null_pointer<const volatile std::nullptr_t>
830 template<
typename _Tp>
831 struct __is_nullptr_t
832 :
public is_null_pointer<_Tp>
833 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
839#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
840 template<
typename _Tp>
842 :
public __bool_constant<__is_reference(_Tp)>
845 template<
typename _Tp>
850 template<
typename _Tp>
851 struct is_reference<_Tp&>
855 template<
typename _Tp>
862 template<
typename _Tp>
864 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
868 template<
typename _Tp>
870 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
872#if __cpp_impl_reflection >= 202506L
879#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
880 template<
typename _Tp>
882 :
public __bool_constant<__is_object(_Tp)>
885 template<
typename _Tp>
887 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
893 struct is_member_pointer;
896 template<
typename _Tp>
898 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
899 is_member_pointer<_Tp>, is_null_pointer<_Tp>
900#if __cpp_impl_reflection >= 202506L
907 template<
typename _Tp>
909 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
912#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
913 template<
typename _Tp>
915 :
public __bool_constant<__is_member_pointer(_Tp)>
919 template<
typename _Tp>
920 struct __is_member_pointer_helper
923 template<
typename _Tp,
typename _Cp>
924 struct __is_member_pointer_helper<_Tp _Cp::*>
925 :
public true_type { };
928 template<
typename _Tp>
930 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
934 template<
typename,
typename>
938 template<
typename _Tp,
typename... _Types>
939 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
942 template<
typename...>
using __void_t = void;
948#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
949 template<
typename _Tp>
951 :
public __bool_constant<__is_const(_Tp)>
958 template<
typename _Tp>
959 struct is_const<_Tp const>
960 :
public true_type { };
964#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
965 template<
typename _Tp>
967 :
public __bool_constant<__is_volatile(_Tp)>
974 template<
typename _Tp>
975 struct is_volatile<_Tp volatile>
976 :
public true_type { };
986 template<
typename _Tp>
988 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible && is_trivially_copyable")
990 : public __bool_constant<__is_trivial(_Tp)>
992 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
993 "template argument must be a complete class or an unbounded array");
997 template<
typename _Tp>
999 :
public __bool_constant<__is_trivially_copyable(_Tp)>
1001 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1002 "template argument must be a complete class or an unbounded array");
1006 template<
typename _Tp>
1008 :
public __bool_constant<__is_standard_layout(_Tp)>
1010 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1011 "template argument must be a complete class or an unbounded array");
1019 template<
typename _Tp>
1021 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
1023 : public __bool_constant<__is_pod(_Tp)>
1025 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1026 "template argument must be a complete class or an unbounded array");
1033 template<
typename _Tp>
1035 _GLIBCXX17_DEPRECATED
1037 :
public __bool_constant<__is_literal_type(_Tp)>
1039 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1040 "template argument must be a complete class or an unbounded array");
1044 template<
typename _Tp>
1046 :
public __bool_constant<__is_empty(_Tp)>
1050 template<
typename _Tp>
1052 :
public __bool_constant<__is_polymorphic(_Tp)>
1055#ifdef __cpp_lib_is_final
1058 template<typename _Tp>
1060 :
public __bool_constant<__is_final(_Tp)>
1065 template<
typename _Tp>
1067 :
public __bool_constant<__is_abstract(_Tp)>
1071 template<
typename _Tp,
1073 struct __is_signed_helper
1076 template<
typename _Tp>
1077 struct __is_signed_helper<_Tp, true>
1078 :
public __bool_constant<_Tp(-1) < _Tp(0)>
1083 template<typename _Tp>
1085 : public __is_signed_helper<_Tp>::type
1089 template<typename _Tp>
1091 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
1095 template<typename _Tp, typename _Up = _Tp&&>
1099 template<typename _Tp>
1104 template<typename _Tp>
1105 auto declval() noexcept -> decltype(__declval<_Tp>(0));
1111 template<typename _Tp>
1112 struct __is_array_known_bounds
1116 template<
typename _Tp,
size_t _Size>
1117 struct __is_array_known_bounds<_Tp[_Size]>
1121 template<
typename _Tp>
1122 struct __is_array_unknown_bounds
1126 template<
typename _Tp>
1127 struct __is_array_unknown_bounds<_Tp[]>
1134#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
1136 template<
typename _Tp>
1138 :
public __bool_constant<__is_destructible(_Tp)>
1148 struct __do_is_destructible_impl
1150 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1157 template<
typename _Tp>
1158 struct __is_destructible_impl
1159 :
public __do_is_destructible_impl
1161 using type =
decltype(__test<_Tp>(0));
1164 template<
typename _Tp,
1165 bool = __or_<is_void<_Tp>,
1166 __is_array_unknown_bounds<_Tp>,
1169 struct __is_destructible_safe;
1171 template<
typename _Tp>
1172 struct __is_destructible_safe<_Tp, false, false>
1173 :
public __is_destructible_impl<typename
1174 remove_all_extents<_Tp>::type>::type
1177 template<
typename _Tp>
1178 struct __is_destructible_safe<_Tp, true, false>
1181 template<
typename _Tp>
1182 struct __is_destructible_safe<_Tp, false, true>
1187 template<
typename _Tp>
1189 :
public __is_destructible_safe<_Tp>::type
1191 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1192 "template argument must be a complete class or an unbounded array");
1196#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
1198 template<
typename _Tp>
1200 :
public __bool_constant<__is_nothrow_destructible(_Tp)>
1209 struct __do_is_nt_destructible_impl
1211 template<
typename _Tp>
1212 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1219 template<
typename _Tp>
1220 struct __is_nt_destructible_impl
1221 :
public __do_is_nt_destructible_impl
1223 using type =
decltype(__test<_Tp>(0));
1226 template<
typename _Tp,
1227 bool = __or_<is_void<_Tp>,
1228 __is_array_unknown_bounds<_Tp>,
1231 struct __is_nt_destructible_safe;
1233 template<
typename _Tp>
1234 struct __is_nt_destructible_safe<_Tp, false, false>
1235 :
public __is_nt_destructible_impl<typename
1236 remove_all_extents<_Tp>::type>::type
1239 template<
typename _Tp>
1240 struct __is_nt_destructible_safe<_Tp, true, false>
1243 template<
typename _Tp>
1244 struct __is_nt_destructible_safe<_Tp, false, true>
1249 template<
typename _Tp>
1251 :
public __is_nt_destructible_safe<_Tp>::type
1253 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1254 "template argument must be a complete class or an unbounded array");
1259 template<
typename _Tp,
typename... _Args>
1260 using __is_constructible_impl
1261 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1265 template<
typename _Tp,
typename... _Args>
1267 :
public __is_constructible_impl<_Tp, _Args...>
1269 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1270 "template argument must be a complete class or an unbounded array");
1274 template<
typename _Tp>
1276 :
public __is_constructible_impl<_Tp>
1278 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1279 "template argument must be a complete class or an unbounded array");
1283#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_lvalue_reference)
1284 template<
typename _Tp>
1285 using __add_lval_ref_t = __add_lvalue_reference(_Tp);
1287 template<
typename _Tp,
typename =
void>
1288 struct __add_lvalue_reference_helper
1289 {
using type = _Tp; };
1291 template<
typename _Tp>
1292 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1293 {
using type = _Tp&; };
1295 template<
typename _Tp>
1296 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1301 template<
typename _Tp>
1303 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1305 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1306 "template argument must be a complete class or an unbounded array");
1310#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_rvalue_reference)
1311 template<
typename _Tp>
1312 using __add_rval_ref_t = __add_rvalue_reference(_Tp);
1314 template<
typename _Tp,
typename =
void>
1315 struct __add_rvalue_reference_helper
1316 {
using type = _Tp; };
1318 template<
typename _Tp>
1319 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1320 {
using type = _Tp&&; };
1322 template<
typename _Tp>
1323 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1328 template<
typename _Tp>
1330 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1332 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1333 "template argument must be a complete class or an unbounded array");
1337 template<
typename _Tp,
typename... _Args>
1338 using __is_nothrow_constructible_impl
1339 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1343 template<
typename _Tp,
typename... _Args>
1345 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1347 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1348 "template argument must be a complete class or an unbounded array");
1352 template<
typename _Tp>
1354 :
public __is_nothrow_constructible_impl<_Tp>
1356 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1357 "template argument must be a complete class or an unbounded array");
1361 template<
typename _Tp>
1363 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1365 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1366 "template argument must be a complete class or an unbounded array");
1370 template<
typename _Tp>
1372 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1374 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1375 "template argument must be a complete class or an unbounded array");
1379 template<
typename _Tp,
typename _Up>
1380 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1384 template<
typename _Tp,
typename _Up>
1386 :
public __is_assignable_impl<_Tp, _Up>
1388 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1389 "template argument must be a complete class or an unbounded array");
1393 template<
typename _Tp>
1395 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1396 __add_lval_ref_t<const _Tp>>
1398 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1399 "template argument must be a complete class or an unbounded array");
1403 template<
typename _Tp>
1405 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_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,
typename _Up>
1413 using __is_nothrow_assignable_impl
1414 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1418 template<
typename _Tp,
typename _Up>
1420 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1422 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1423 "template argument must be a complete class or an unbounded array");
1427 template<
typename _Tp>
1429 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1430 __add_lval_ref_t<const _Tp>>
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_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1440 __add_rval_ref_t<_Tp>>
1442 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1443 "template argument must be a complete class or an unbounded array");
1447 template<
typename _Tp,
typename... _Args>
1448 using __is_trivially_constructible_impl
1449 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1453 template<
typename _Tp,
typename... _Args>
1455 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1457 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1458 "template argument must be a complete class or an unbounded array");
1462 template<
typename _Tp>
1464 :
public __is_trivially_constructible_impl<_Tp>
1466 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1467 "template argument must be a complete class or an unbounded array");
1470#if __cpp_variable_templates && __cpp_concepts
1471 template<
typename _Tp>
1472 constexpr bool __is_implicitly_default_constructible_v
1473 =
requires (void(&__f)(_Tp)) { __f({}); };
1475 template<
typename _Tp>
1476 struct __is_implicitly_default_constructible
1477 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1480 struct __do_is_implicitly_default_constructible_impl
1482 template <
typename _Tp>
1483 static void __helper(
const _Tp&);
1485 template <
typename _Tp>
1487 decltype(__helper<const _Tp&>({}))* = 0);
1492 template<
typename _Tp>
1493 struct __is_implicitly_default_constructible_impl
1494 :
public __do_is_implicitly_default_constructible_impl
1499 template<
typename _Tp>
1500 struct __is_implicitly_default_constructible_safe
1501 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1504 template <
typename _Tp>
1505 struct __is_implicitly_default_constructible
1506 :
public __and_<__is_constructible_impl<_Tp>,
1507 __is_implicitly_default_constructible_safe<_Tp>>::type
1512 template<
typename _Tp>
1514 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1516 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1517 "template argument must be a complete class or an unbounded array");
1521 template<
typename _Tp>
1523 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_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,
typename _Up>
1531 using __is_trivially_assignable_impl
1532 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1536 template<
typename _Tp,
typename _Up>
1538 :
public __is_trivially_assignable_impl<_Tp, _Up>
1540 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1541 "template argument must be a complete class or an unbounded array");
1545 template<
typename _Tp>
1547 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1548 __add_lval_ref_t<const _Tp>>
1550 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1551 "template argument must be a complete class or an unbounded array");
1555 template<
typename _Tp>
1557 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1558 __add_rval_ref_t<_Tp>>
1560 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1561 "template argument must be a complete class or an unbounded array");
1564#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
1566 template<
typename _Tp>
1568 :
public __bool_constant<__is_trivially_destructible(_Tp)>
1572 template<
typename _Tp>
1574 :
public __and_<__is_destructible_safe<_Tp>,
1575 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1577 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1578 "template argument must be a complete class or an unbounded array");
1583 template<
typename _Tp>
1585 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1587 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1588 "template argument must be a complete class or an unbounded array");
1595 template<
typename _Tp>
1599 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1600 "template argument must be a complete class or an unbounded array");
1604#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
1605 && (!defined(__clang__) || __clang_major__ >= 20)
1606 template<
typename _Tp>
1614 template<
typename _Tp, std::
size_t _Size>
1615 struct rank<_Tp[_Size]>
1616 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1618 template<
typename _Tp>
1624 template<
typename,
unsigned _U
int = 0>
1628 template<
typename _Tp,
size_t _Size>
1629 struct extent<_Tp[_Size], 0>
1632 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1633 struct extent<_Tp[_Size], _Uint>
1634 :
public extent<_Tp, _Uint - 1>::type { };
1636 template<
typename _Tp>
1640 template<
typename _Tp,
unsigned _U
int>
1641 struct extent<_Tp[], _Uint>
1642 :
public extent<_Tp, _Uint - 1>::type { };
1648#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1649 template<
typename _Tp,
typename _Up>
1651 :
public __bool_constant<__is_same(_Tp, _Up)>
1654 template<
typename _Tp,
typename _Up>
1659 template<
typename _Tp>
1660 struct is_same<_Tp, _Tp>
1666 template<
typename _Base,
typename _Derived>
1668 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1671#ifdef __cpp_lib_is_virtual_base_of
1674 template<typename _Base, typename _Derived>
1675 struct is_virtual_base_of
1676 :
public bool_constant<__builtin_is_virtual_base_of(_Base, _Derived)>
1680#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1681 template<
typename _From,
typename _To>
1682 struct is_convertible
1683 :
public __bool_constant<__is_convertible(_From, _To)>
1686 template<
typename _From,
typename _To,
1689 struct __is_convertible_helper
1691 using type =
typename is_void<_To>::type;
1694#pragma GCC diagnostic push
1695#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1696 template<
typename _From,
typename _To>
1697 class __is_convertible_helper<_From, _To, false>
1699 template<
typename _To1>
1700 static void __test_aux(_To1)
noexcept;
1702 template<
typename _From1,
typename _To1,
1707 template<
typename,
typename>
1712 using type =
decltype(__test<_From, _To>(0));
1714#pragma GCC diagnostic pop
1717 template<
typename _From,
typename _To>
1718 struct is_convertible
1719 :
public __is_convertible_helper<_From, _To>::type
1724 template<
typename _ToElementType,
typename _FromElementType>
1725 using __is_array_convertible
1726 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1728#ifdef __cpp_lib_is_nothrow_convertible
1730#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1732 template<
typename _From,
typename _To>
1733 inline constexpr bool is_nothrow_convertible_v
1734 = __is_nothrow_convertible(_From, _To);
1737 template<
typename _From,
typename _To>
1738 struct is_nothrow_convertible
1739 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1742 template<
typename _From,
typename _To,
1745 struct __is_nt_convertible_helper
1749#pragma GCC diagnostic push
1750#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1751 template<
typename _From,
typename _To>
1752 class __is_nt_convertible_helper<_From, _To, false>
1754 template<
typename _To1>
1755 static void __test_aux(_To1)
noexcept;
1757 template<
typename _From1,
typename _To1>
1762 template<
typename,
typename>
1767 using type =
decltype(__test<_From, _To>(0));
1769#pragma GCC diagnostic pop
1772 template<
typename _From,
typename _To>
1773 struct is_nothrow_convertible
1774 :
public __is_nt_convertible_helper<_From, _To>::type
1778 template<
typename _From,
typename _To>
1779 inline constexpr bool is_nothrow_convertible_v
1780 = is_nothrow_convertible<_From, _To>::value;
1784#pragma GCC diagnostic push
1785#pragma GCC diagnostic ignored "-Wc++14-extensions"
1786 template<
typename _Tp,
typename... _Args>
1787 struct __is_nothrow_new_constructible_impl
1789 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1793 template<
typename _Tp,
typename... _Args>
1794 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1796 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1797#pragma GCC diagnostic pop
1802 template<
typename _Tp>
1804 {
using type = _Tp; };
1806 template<
typename _Tp>
1808 {
using type = _Tp; };
1811 template<
typename _Tp>
1813 {
using type = _Tp; };
1815 template<
typename _Tp>
1817 {
using type = _Tp; };
1820#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1821 template<
typename _Tp>
1823 {
using type = __remove_cv(_Tp); };
1825 template<
typename _Tp>
1827 {
using type = _Tp; };
1829 template<
typename _Tp>
1830 struct remove_cv<const _Tp>
1831 {
using type = _Tp; };
1833 template<
typename _Tp>
1835 {
using type = _Tp; };
1837 template<
typename _Tp>
1839 {
using type = _Tp; };
1843 template<
typename _Tp>
1845 {
using type = _Tp
const; };
1848 template<
typename _Tp>
1850 {
using type = _Tp
volatile; };
1853 template<
typename _Tp>
1855 {
using type = _Tp
const volatile; };
1857#ifdef __cpp_lib_transformation_trait_aliases
1859 template<typename _Tp>
1860 using remove_const_t =
typename remove_const<_Tp>::type;
1863 template<
typename _Tp>
1864 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1867 template<
typename _Tp>
1868 using remove_cv_t =
typename remove_cv<_Tp>::type;
1871 template<
typename _Tp>
1872 using add_const_t =
typename add_const<_Tp>::type;
1875 template<
typename _Tp>
1876 using add_volatile_t =
typename add_volatile<_Tp>::type;
1879 template<
typename _Tp>
1880 using add_cv_t =
typename add_cv<_Tp>::type;
1886#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1887 template<
typename _Tp>
1889 {
using type = __remove_reference(_Tp); };
1891 template<
typename _Tp>
1893 {
using type = _Tp; };
1895 template<
typename _Tp>
1896 struct remove_reference<_Tp&>
1897 {
using type = _Tp; };
1899 template<
typename _Tp>
1901 {
using type = _Tp; };
1905 template<
typename _Tp>
1907 {
using type = __add_lval_ref_t<_Tp>; };
1910 template<
typename _Tp>
1912 {
using type = __add_rval_ref_t<_Tp>; };
1914#if __cplusplus > 201103L
1916 template<
typename _Tp>
1920 template<
typename _Tp>
1924 template<
typename _Tp>
1933 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1934 struct __cv_selector;
1936 template<
typename _Unqualified>
1937 struct __cv_selector<_Unqualified, false, false>
1938 {
using __type = _Unqualified; };
1940 template<
typename _Unqualified>
1941 struct __cv_selector<_Unqualified, false, true>
1942 {
using __type =
volatile _Unqualified; };
1944 template<
typename _Unqualified>
1945 struct __cv_selector<_Unqualified, true, false>
1946 {
using __type =
const _Unqualified; };
1948 template<
typename _Unqualified>
1949 struct __cv_selector<_Unqualified, true, true>
1950 {
using __type =
const volatile _Unqualified; };
1952 template<
typename _Qualified,
typename _Unqualified,
1955 class __match_cv_qualifiers
1957 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1960 using __type =
typename __match::__type;
1964 template<
typename _Tp>
1965 struct __make_unsigned
1966 {
using __type = _Tp; };
1969 struct __make_unsigned<char>
1970 {
using __type =
unsigned char; };
1973 struct __make_unsigned<signed char>
1974 {
using __type =
unsigned char; };
1977 struct __make_unsigned<short>
1978 {
using __type =
unsigned short; };
1981 struct __make_unsigned<int>
1982 {
using __type =
unsigned int; };
1985 struct __make_unsigned<long>
1986 {
using __type =
unsigned long; };
1989 struct __make_unsigned<long long>
1990 {
using __type =
unsigned long long; };
1992#if defined(__GLIBCXX_TYPE_INT_N_0)
1995 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1996 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1998#if defined(__GLIBCXX_TYPE_INT_N_1)
2001 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
2002 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
2004#if defined(__GLIBCXX_TYPE_INT_N_2)
2007 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
2008 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
2010#if defined(__GLIBCXX_TYPE_INT_N_3)
2013 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
2014 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
2016#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
2019 struct __make_unsigned<__int128>
2020 {
using __type =
unsigned __int128; };
2024 template<
typename _Tp,
2026 bool _IsEnum = __is_enum(_Tp)>
2027 class __make_unsigned_selector;
2029 template<
typename _Tp>
2030 class __make_unsigned_selector<_Tp, true, false>
2032 using __unsigned_type
2033 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
2037 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2040 class __make_unsigned_selector_base
2043 template<
typename...>
struct _List { };
2045 template<
typename _Tp,
typename... _Up>
2046 struct _List<_Tp, _Up...> : _List<_Up...>
2047 {
static constexpr size_t __size =
sizeof(_Tp); };
2049 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
2052 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
2053 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
2054 {
using __type = _Uint; };
2056 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
2057 struct __select<_Sz, _List<_Uint, _UInts...>, false>
2058 : __select<_Sz, _List<_UInts...>>
2063 template<
typename _Tp>
2064 class __make_unsigned_selector<_Tp, false, true>
2065 : __make_unsigned_selector_base
2069 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
2070 unsigned long,
unsigned long long
2071#ifdef __SIZEOF_INT128__
2076 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
2080 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
2088 struct __make_unsigned<wchar_t>
2091 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
2094#ifdef _GLIBCXX_USE_CHAR8_T
2096 struct __make_unsigned<char8_t>
2099 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
2104 struct __make_unsigned<char16_t>
2107 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
2111 struct __make_unsigned<char32_t>
2114 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
2122 template<
typename _Tp>
2124 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
2135 template<
typename _Tp>
2136 struct __make_signed
2137 {
using __type = _Tp; };
2140 struct __make_signed<char>
2141 {
using __type =
signed char; };
2144 struct __make_signed<unsigned char>
2145 {
using __type =
signed char; };
2148 struct __make_signed<unsigned short>
2149 {
using __type =
signed short; };
2152 struct __make_signed<unsigned int>
2153 {
using __type =
signed int; };
2156 struct __make_signed<unsigned long>
2157 {
using __type =
signed long; };
2160 struct __make_signed<unsigned long long>
2161 {
using __type =
signed long long; };
2163#if defined(__GLIBCXX_TYPE_INT_N_0)
2166 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
2167 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
2169#if defined(__GLIBCXX_TYPE_INT_N_1)
2172 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
2173 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
2175#if defined(__GLIBCXX_TYPE_INT_N_2)
2178 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
2179 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
2181#if defined(__GLIBCXX_TYPE_INT_N_3)
2184 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
2185 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
2187#if defined __SIZEOF_INT128__ && defined __STRICT_ANSI__
2190 struct __make_signed<unsigned __int128>
2191 {
using __type = __int128; };
2195 template<
typename _Tp,
2197 bool _IsEnum = __is_enum(_Tp)>
2198 class __make_signed_selector;
2200 template<
typename _Tp>
2201 class __make_signed_selector<_Tp, true, false>
2204 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2208 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2212 template<
typename _Tp>
2213 class __make_signed_selector<_Tp, false, true>
2215 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2218 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2226 struct __make_signed<wchar_t>
2229 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2232#if defined(_GLIBCXX_USE_CHAR8_T)
2234 struct __make_signed<char8_t>
2237 =
typename __make_signed_selector<char8_t, false, true>::__type;
2242 struct __make_signed<char16_t>
2245 =
typename __make_signed_selector<char16_t, false, true>::__type;
2249 struct __make_signed<char32_t>
2252 =
typename __make_signed_selector<char32_t, false, true>::__type;
2260 template<
typename _Tp>
2262 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2268 template<>
struct make_signed<bool const volatile>;
2270#if __cplusplus > 201103L
2272 template<
typename _Tp>
2276 template<
typename _Tp>
2283#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent)
2284 template<
typename _Tp>
2286 {
using type = __remove_extent(_Tp); };
2288 template<
typename _Tp>
2290 {
using type = _Tp; };
2292 template<
typename _Tp, std::
size_t _Size>
2293 struct remove_extent<_Tp[_Size]>
2294 {
using type = _Tp; };
2296 template<
typename _Tp>
2298 {
using type = _Tp; };
2302#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_all_extents)
2303 template<
typename _Tp>
2305 {
using type = __remove_all_extents(_Tp); };
2307 template<
typename _Tp>
2309 {
using type = _Tp; };
2311 template<
typename _Tp, std::
size_t _Size>
2312 struct remove_all_extents<_Tp[_Size]>
2313 {
using type =
typename remove_all_extents<_Tp>::type; };
2315 template<
typename _Tp>
2317 {
using type =
typename remove_all_extents<_Tp>::type; };
2320#if __cplusplus > 201103L
2322 template<
typename _Tp>
2326 template<
typename _Tp>
2333#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2334 template<
typename _Tp>
2336 {
using type = __remove_pointer(_Tp); };
2338 template<
typename _Tp,
typename>
2339 struct __remove_pointer_helper
2340 {
using type = _Tp; };
2342 template<
typename _Tp,
typename _Up>
2343 struct __remove_pointer_helper<_Tp, _Up*>
2344 {
using type = _Up; };
2346 template<
typename _Tp>
2348 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2353#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_pointer)
2354 template<
typename _Tp>
2356 {
using type = __add_pointer(_Tp); };
2358 template<
typename _Tp,
typename =
void>
2359 struct __add_pointer_helper
2360 {
using type = _Tp; };
2362 template<
typename _Tp>
2363 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2364 {
using type = _Tp*; };
2366 template<
typename _Tp>
2368 :
public __add_pointer_helper<_Tp>
2371 template<
typename _Tp>
2373 {
using type = _Tp*; };
2375 template<
typename _Tp>
2377 {
using type = _Tp*; };
2380#if __cplusplus > 201103L
2382 template<
typename _Tp>
2386 template<
typename _Tp>
2393 struct __attribute__((__aligned__)) __aligned_storage_max_align_t
2397 __aligned_storage_default_alignment([[__maybe_unused__]]
size_t __len)
2399#if _GLIBCXX_INLINE_VERSION
2401 = integral_constant<size_t,
alignof(__aligned_storage_max_align_t)>;
2403 return __len > (_Max_align::value / 2)
2405#
if _GLIBCXX_USE_BUILTIN_TRAIT(__builtin_clzg)
2406 : 1 << (__SIZE_WIDTH__ - __builtin_clzg(__len - 1u));
2408 : 1 << (__LLONG_WIDTH__ - __builtin_clzll(__len - 1ull));
2413 return alignof(__aligned_storage_max_align_t);
2449 template<
size_t _Len,
2450 size_t _Align = __aligned_storage_default_alignment(_Len)>
2452 _GLIBCXX23_DEPRECATED
2457 alignas(_Align)
unsigned char __data[_Len];
2461 template <
typename... _Types>
2462 struct __strictest_alignment
2464 static const size_t _S_alignment = 0;
2465 static const size_t _S_size = 0;
2468 template <
typename _Tp,
typename... _Types>
2469 struct __strictest_alignment<_Tp, _Types...>
2471 static const size_t _S_alignment =
2472 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2473 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2474 static const size_t _S_size =
2475 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2476 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2479#pragma GCC diagnostic push
2480#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2494 template <
size_t _Len,
typename... _Types>
2496 _GLIBCXX23_DEPRECATED
2500 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2502 using __strictest = __strictest_alignment<_Types...>;
2503 static const size_t _S_len = _Len > __strictest::_S_size
2504 ? _Len : __strictest::_S_size;
2509 using type =
typename aligned_storage<_S_len, alignment_value>::type;
2512 template <
size_t _Len,
typename... _Types>
2513 const size_t aligned_union<_Len, _Types...>::alignment_value;
2514#pragma GCC diagnostic pop
2518#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
2519 template<
typename _Tp>
2521 {
using type = __decay(_Tp); };
2525 template<
typename _Up>
2526 struct __decay_selector
2527 : __conditional_t<is_const<const _Up>::value,
2532 template<
typename _Up,
size_t _Nm>
2533 struct __decay_selector<_Up[_Nm]>
2534 {
using type = _Up*; };
2536 template<
typename _Up>
2537 struct __decay_selector<_Up[]>
2538 {
using type = _Up*; };
2543 template<
typename _Tp>
2545 {
using type =
typename __decay_selector<_Tp>::type; };
2547 template<
typename _Tp>
2549 {
using type =
typename __decay_selector<_Tp>::type; };
2551 template<
typename _Tp>
2553 {
using type =
typename __decay_selector<_Tp>::type; };
2559 template<
typename _Tp>
2560 struct __strip_reference_wrapper
2565 template<
typename _Tp>
2568 using __type = _Tp&;
2572 template<
typename _Tp>
2573 using __decay_t =
typename decay<_Tp>::type;
2575 template<
typename _Tp>
2576 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2582 template<
typename... _Cond>
2583 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2586 template<
typename _Tp>
2587 using __remove_cvref_t
2593 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2595 {
using type = _Iftrue; };
2598 template<
typename _Iftrue,
typename _Iffalse>
2600 {
using type = _Iffalse; };
2603 template<
typename... _Tp>
2615 template<
typename _Tp>
2616 struct __success_type
2617 {
using type = _Tp; };
2619 struct __failure_type
2622 struct __do_common_type_impl
2624 template<
typename _Tp,
typename _Up>
2630 template<
typename _Tp,
typename _Up>
2631 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2634#if __cplusplus > 201703L
2637 template<
typename _Tp,
typename _Up>
2638 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2642 template<
typename,
typename>
2643 static __failure_type
2646 template<
typename _Tp,
typename _Up>
2647 static decltype(_S_test_2<_Tp, _Up>(0))
2657 template<
typename _Tp0>
2663 template<
typename _Tp1,
typename _Tp2,
2664 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2665 struct __common_type_impl
2669 using type = common_type<_Dp1, _Dp2>;
2672 template<
typename _Tp1,
typename _Tp2>
2673 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2674 :
private __do_common_type_impl
2678 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2682 template<
typename _Tp1,
typename _Tp2>
2684 :
public __common_type_impl<_Tp1, _Tp2>::type
2687 template<
typename...>
2688 struct __common_type_pack
2691 template<
typename,
typename,
typename =
void>
2692 struct __common_type_fold;
2695 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2697 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2698 __common_type_pack<_Rp...>>
2704 template<
typename _CTp,
typename... _Rp>
2705 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2706 __void_t<typename _CTp::type>>
2711 template<
typename _CTp,
typename _Rp>
2712 struct __common_type_fold<_CTp, _Rp, void>
2715 template<
typename _Tp,
bool = __is_enum(_Tp)>
2716 struct __underlying_type_impl
2718 using type = __underlying_type(_Tp);
2721 template<
typename _Tp>
2722 struct __underlying_type_impl<_Tp, false>
2727 template<
typename _Tp>
2729 :
public __underlying_type_impl<_Tp>
2733 template<
typename _Tp>
2734 struct __declval_protector
2736 static const bool __stop =
false;
2744 template<
typename _Tp>
2745 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2747 static_assert(__declval_protector<_Tp>::__stop,
2748 "declval() must not be used!");
2749 return __declval<_Tp>(0);
2753 template<
typename _Signature>
2759 struct __invoke_memfun_ref { };
2760 struct __invoke_memfun_deref { };
2761 struct __invoke_memobj_ref { };
2762 struct __invoke_memobj_deref { };
2763 struct __invoke_other { };
2766 template<
typename _Tp,
typename _Tag>
2767 struct __result_of_success : __success_type<_Tp>
2768 {
using __invoke_type = _Tag; };
2771 struct __result_of_memfun_ref_impl
2773 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2774 static __result_of_success<
decltype(
2776 ), __invoke_memfun_ref> _S_test(
int);
2778 template<
typename...>
2779 static __failure_type _S_test(...);
2782 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2783 struct __result_of_memfun_ref
2784 :
private __result_of_memfun_ref_impl
2786 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2790 struct __result_of_memfun_deref_impl
2792 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2793 static __result_of_success<
decltype(
2795 ), __invoke_memfun_deref> _S_test(
int);
2797 template<
typename...>
2798 static __failure_type _S_test(...);
2801 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2802 struct __result_of_memfun_deref
2803 :
private __result_of_memfun_deref_impl
2805 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2809 struct __result_of_memobj_ref_impl
2811 template<
typename _Fp,
typename _Tp1>
2812 static __result_of_success<
decltype(
2814 ), __invoke_memobj_ref> _S_test(
int);
2816 template<
typename,
typename>
2817 static __failure_type _S_test(...);
2820 template<
typename _MemPtr,
typename _Arg>
2821 struct __result_of_memobj_ref
2822 :
private __result_of_memobj_ref_impl
2824 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2828 struct __result_of_memobj_deref_impl
2830 template<
typename _Fp,
typename _Tp1>
2831 static __result_of_success<
decltype(
2833 ), __invoke_memobj_deref> _S_test(
int);
2835 template<
typename,
typename>
2836 static __failure_type _S_test(...);
2839 template<
typename _MemPtr,
typename _Arg>
2840 struct __result_of_memobj_deref
2841 :
private __result_of_memobj_deref_impl
2843 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2846 template<
typename _MemPtr,
typename _Arg>
2847 struct __result_of_memobj;
2849 template<
typename _Res,
typename _Class,
typename _Arg>
2850 struct __result_of_memobj<_Res _Class::*, _Arg>
2852 using _Argval = __remove_cvref_t<_Arg>;
2853 using _MemPtr = _Res _Class::*;
2856 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2857 is_base_of<_Class, _Argval>>::value,
2858 __result_of_memobj_ref<_MemPtr, _Arg>,
2859 __result_of_memobj_deref<_MemPtr, _Arg>
2863 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2864 struct __result_of_memfun;
2866 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2867 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2869 using _Argval =
typename remove_reference<_Arg>::type;
2870 using _MemPtr = _Res _Class::*;
2871 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2872 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2873 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2882 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2888 template<
typename _Tp,
typename _Up>
2894 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2895 struct __result_of_impl
2897 using type = __failure_type;
2900 template<
typename _MemPtr,
typename _Arg>
2901 struct __result_of_impl<true, false, _MemPtr, _Arg>
2902 :
public __result_of_memobj<__decay_t<_MemPtr>,
2903 typename __inv_unwrap<_Arg>::type>
2906 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2907 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2908 :
public __result_of_memfun<__decay_t<_MemPtr>,
2909 typename __inv_unwrap<_Arg>::type, _Args...>
2913 struct __result_of_other_impl
2915 template<
typename _Fn,
typename... _Args>
2916 static __result_of_success<
decltype(
2918 ), __invoke_other> _S_test(
int);
2920 template<
typename...>
2921 static __failure_type _S_test(...);
2924 template<
typename _Functor,
typename... _ArgTypes>
2925 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2926 :
private __result_of_other_impl
2928 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2932 template<
typename _Functor,
typename... _ArgTypes>
2933 struct __invoke_result
2934 :
public __result_of_impl<
2935 is_member_object_pointer<
2936 typename remove_reference<_Functor>::type
2938 is_member_function_pointer<
2939 typename remove_reference<_Functor>::type
2941 _Functor, _ArgTypes...
2946 template<
typename _Fn,
typename... _Args>
2947 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2950 template<
typename _Functor,
typename... _ArgTypes>
2951 struct result_of<_Functor(_ArgTypes...)>
2952 :
public __invoke_result<_Functor, _ArgTypes...>
2953 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2955#if __cplusplus >= 201402L
2956#pragma GCC diagnostic push
2957#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2959 template<
size_t _Len,
2960 size_t _Align = __aligned_storage_default_alignment(_Len)>
2961 using aligned_storage_t _GLIBCXX23_DEPRECATED =
typename aligned_storage<_Len, _Align>::type;
2963 template <
size_t _Len,
typename... _Types>
2964 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2965#pragma GCC diagnostic pop
2968 template<
typename _Tp>
2969 using decay_t =
typename decay<_Tp>::type;
2972 template<
bool _Cond,
typename _Tp =
void>
2976 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2977 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2980 template<
typename... _Tp>
2984 template<
typename _Tp>
2988 template<
typename _Tp>
2992#ifdef __cpp_lib_void_t
2994 template<typename...> using void_t = void;
3004 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
3005 struct __detected_or
3012 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
3013 requires requires {
typename _Op<_Args...>; }
3014 struct __detected_or<_Def, _Op, _Args...>
3016 using type = _Op<_Args...>;
3021 template<
typename _Default,
typename _AlwaysVoid,
3022 template<
typename...>
class _Op,
typename... _Args>
3025 using type = _Default;
3030 template<
typename _Default,
template<
typename...>
class _Op,
3032 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
3034 using type = _Op<_Args...>;
3038 template<
typename _Default,
template<
typename...>
class _Op,
3040 using __detected_or = __detector<_Default, void, _Op, _Args...>;
3044 template<
typename _Default,
template<
typename...>
class _Op,
3046 using __detected_or_t
3047 =
typename __detected_or<_Default, _Op, _Args...>::type;
3049 template <
typename _Tp>
3050 struct __is_swappable;
3052 template <
typename _Tp>
3053 struct __is_nothrow_swappable;
3060 template<
typename _Tp>
3061 struct __is_tuple_like
3062 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
3065#if defined(__glibcxx_apply) || defined(__glibcxx_make_from_tuple)
3067 template<
template<
typename...>
class _Trait,
typename _Tp,
typename _Tuple>
3068 constexpr auto __unpack_tuple_like_impl =
false_type{};
3070 template<
template<
typename...>
class _Trait,
typename _Tp,
typename _Tuple>
3071 constexpr bool __unpack_tuple_like_v = __unpack_tuple_like_impl<_Trait, _Tp, _Tuple>.value;
3074 template<
template<
typename...>
class _Trait,
typename _Tp,
typename _Tuple>
3075 constexpr bool __noexcept_unpack_tuple_like_v = __unpack_tuple_like_impl<_Trait, _Tp, _Tuple>.value;
3079 template<
typename _Tp>
3080 _GLIBCXX20_CONSTEXPR
3082 _Require<__not_<__is_tuple_like<_Tp>>,
3086 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
3089 template<
typename _Tp,
size_t _Nm>
3090 _GLIBCXX20_CONSTEXPR
3092 __enable_if_t<__is_swappable<_Tp>::value>
3093 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
3094 noexcept(__is_nothrow_swappable<_Tp>::value);
3097 namespace __swappable_details {
3100 struct __do_is_swappable_impl
3102 template<
typename _Tp,
typename
3104 static true_type __test(
int);
3110 struct __do_is_nothrow_swappable_impl
3112 template<
typename _Tp>
3113 static __bool_constant<
3123 template<
typename _Tp>
3124 struct __is_swappable_impl
3125 :
public __swappable_details::__do_is_swappable_impl
3127 using type =
decltype(__test<_Tp>(0));
3130 template<
typename _Tp>
3131 struct __is_nothrow_swappable_impl
3132 :
public __swappable_details::__do_is_nothrow_swappable_impl
3134 using type =
decltype(__test<_Tp>(0));
3137 template<
typename _Tp>
3138 struct __is_swappable
3139 :
public __is_swappable_impl<_Tp>::type
3142 template<
typename _Tp>
3143 struct __is_nothrow_swappable
3144 :
public __is_nothrow_swappable_impl<_Tp>::type
3148#ifdef __cpp_lib_is_swappable
3152 template<
typename _Tp>
3154 :
public __is_swappable_impl<_Tp>::type
3156 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3157 "template argument must be a complete class or an unbounded array");
3161 template<
typename _Tp>
3162 struct is_nothrow_swappable
3163 :
public __is_nothrow_swappable_impl<_Tp>::type
3165 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3166 "template argument must be a complete class or an unbounded array");
3169#if __cplusplus >= 201402L
3171 template<
typename _Tp>
3172 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
3173 is_swappable<_Tp>::value;
3176 template<
typename _Tp>
3177 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
3178 is_nothrow_swappable<_Tp>::value;
3182 namespace __swappable_with_details {
3185 struct __do_is_swappable_with_impl
3187 template<
typename _Tp,
typename _Up,
typename
3193 template<
typename,
typename>
3197 struct __do_is_nothrow_swappable_with_impl
3199 template<
typename _Tp,
typename _Up>
3200 static __bool_constant<
3206 template<
typename,
typename>
3212 template<
typename _Tp,
typename _Up>
3213 struct __is_swappable_with_impl
3214 :
public __swappable_with_details::__do_is_swappable_with_impl
3216 using type =
decltype(__test<_Tp, _Up>(0));
3220 template<
typename _Tp>
3221 struct __is_swappable_with_impl<_Tp&, _Tp&>
3222 :
public __swappable_details::__do_is_swappable_impl
3224 using type =
decltype(__test<_Tp&>(0));
3227 template<
typename _Tp,
typename _Up>
3228 struct __is_nothrow_swappable_with_impl
3229 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
3231 using type =
decltype(__test<_Tp, _Up>(0));
3235 template<
typename _Tp>
3236 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
3237 :
public __swappable_details::__do_is_nothrow_swappable_impl
3239 using type =
decltype(__test<_Tp&>(0));
3244 template<
typename _Tp,
typename _Up>
3245 struct is_swappable_with
3246 :
public __is_swappable_with_impl<_Tp, _Up>::type
3248 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3249 "first template argument must be a complete class or an unbounded array");
3250 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3251 "second template argument must be a complete class or an unbounded array");
3255 template<
typename _Tp,
typename _Up>
3256 struct is_nothrow_swappable_with
3257 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
3259 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3260 "first template argument must be a complete class or an unbounded array");
3261 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3262 "second template argument must be a complete class or an unbounded array");
3265#if __cplusplus >= 201402L
3267 template<
typename _Tp,
typename _Up>
3268 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3269 is_swappable_with<_Tp, _Up>::value;
3272 template<
typename _Tp,
typename _Up>
3273 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3274 is_nothrow_swappable_with<_Tp, _Up>::value;
3284 template<
typename _Result,
typename _Ret,
3286 struct __is_invocable_impl
3293 template<
typename _Result,
typename _Ret>
3294 struct __is_invocable_impl<_Result, _Ret,
3296 __void_t<typename _Result::type>>
3302#pragma GCC diagnostic push
3303#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3305 template<
typename _Result,
typename _Ret>
3306 struct __is_invocable_impl<_Result, _Ret,
3308 __void_t<typename _Result::type>>
3312 using _Res_t =
typename _Result::type;
3316 static _Res_t _S_get() noexcept;
3319 template<typename _Tp>
3320 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3323 template<typename _Tp,
3324 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3325 typename = decltype(_S_conv<_Tp>(_S_get())),
3326#if __has_builtin(__reference_converts_from_temporary)
3327 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3329 bool _Dangle =
false
3332 static __bool_constant<_Nothrow && !_Dangle>
3335 template<
typename _Tp,
bool = false>
3341 using type =
decltype(_S_test<_Ret,
true>(1));
3344 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3346#pragma GCC diagnostic pop
3348 template<
typename _Fn,
typename... _ArgTypes>
3349 struct __is_invocable
3350#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3351 : __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3353 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3357 template<
typename _Fn,
typename _Tp,
typename... _Args>
3358 constexpr bool __call_is_nt(__invoke_memfun_ref)
3360 using _Up =
typename __inv_unwrap<_Tp>::type;
3365 template<
typename _Fn,
typename _Tp,
typename... _Args>
3366 constexpr bool __call_is_nt(__invoke_memfun_deref)
3372 template<
typename _Fn,
typename _Tp>
3373 constexpr bool __call_is_nt(__invoke_memobj_ref)
3375 using _Up =
typename __inv_unwrap<_Tp>::type;
3379 template<
typename _Fn,
typename _Tp>
3380 constexpr bool __call_is_nt(__invoke_memobj_deref)
3385 template<
typename _Fn,
typename... _Args>
3386 constexpr bool __call_is_nt(__invoke_other)
3391 template<
typename _Result,
typename _Fn,
typename... _Args>
3392 struct __call_is_nothrow
3394 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3398 template<
typename _Fn,
typename... _Args>
3399 using __call_is_nothrow_
3400 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3403 template<
typename _Fn,
typename... _Args>
3404 struct __is_nothrow_invocable
3405#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3406 : __bool_constant<__is_nothrow_invocable(_Fn, _Args...)>
3408 : __and_<__is_invocable<_Fn, _Args...>,
3409 __call_is_nothrow_<_Fn, _Args...>>::type
3413#pragma GCC diagnostic push
3414#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3415 struct __nonesuchbase {};
3416 struct __nonesuch :
private __nonesuchbase {
3417 ~__nonesuch() =
delete;
3418 __nonesuch(__nonesuch
const&) =
delete;
3419 void operator=(__nonesuch
const&) =
delete;
3421#pragma GCC diagnostic pop
3424#ifdef __cpp_lib_is_invocable
3426 template<typename _Functor, typename... _ArgTypes>
3427 struct invoke_result
3428 :
public __invoke_result<_Functor, _ArgTypes...>
3430 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3431 "_Functor must be a complete class or an unbounded array");
3432 static_assert((std::__is_complete_or_unbounded(
3433 __type_identity<_ArgTypes>{}) && ...),
3434 "each argument type must be a complete class or an unbounded array");
3438 template<
typename _Fn,
typename... _Args>
3439 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3442 template<
typename _Fn,
typename... _ArgTypes>
3444#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3445 :
public __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3447 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3450 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3451 "_Fn must be a complete class or an unbounded array");
3452 static_assert((std::__is_complete_or_unbounded(
3453 __type_identity<_ArgTypes>{}) && ...),
3454 "each argument type must be a complete class or an unbounded array");
3458 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3459 struct is_invocable_r
3460 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3462 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3463 "_Fn must be a complete class or an unbounded array");
3464 static_assert((std::__is_complete_or_unbounded(
3465 __type_identity<_ArgTypes>{}) && ...),
3466 "each argument type must be a complete class or an unbounded array");
3467 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3468 "_Ret must be a complete class or an unbounded array");
3472 template<
typename _Fn,
typename... _ArgTypes>
3473 struct is_nothrow_invocable
3474#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3475 :
public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)>
3477 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3478 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3481 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3482 "_Fn must be a complete class or an unbounded array");
3483 static_assert((std::__is_complete_or_unbounded(
3484 __type_identity<_ArgTypes>{}) && ...),
3485 "each argument type must be a complete class or an unbounded array");
3492 template<
typename _Result,
typename _Ret>
3493 using __is_nt_invocable_impl
3494 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3498 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3499 struct is_nothrow_invocable_r
3500 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3501 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3503 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3504 "_Fn must be a complete class or an unbounded array");
3505 static_assert((std::__is_complete_or_unbounded(
3506 __type_identity<_ArgTypes>{}) && ...),
3507 "each argument type must be a complete class or an unbounded array");
3508 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3509 "_Ret must be a complete class or an unbounded array");
3513#if __cpp_lib_type_trait_variable_templates
3528template <
typename _Tp>
3530template <
typename _Tp>
3531 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3532template <
typename _Tp>
3534template <
typename _Tp>
3537#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3538template <
typename _Tp>
3539 inline constexpr bool is_array_v = __is_array(_Tp);
3541template <
typename _Tp>
3542 inline constexpr bool is_array_v =
false;
3543template <
typename _Tp>
3544 inline constexpr bool is_array_v<_Tp[]> =
true;
3545template <
typename _Tp,
size_t _Num>
3546 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3549#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
3550template <
typename _Tp>
3551 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
3553template <
typename _Tp>
3554 inline constexpr bool is_pointer_v =
false;
3555template <
typename _Tp>
3556 inline constexpr bool is_pointer_v<_Tp*> =
true;
3557template <
typename _Tp>
3558 inline constexpr bool is_pointer_v<_Tp* const> =
true;
3559template <
typename _Tp>
3560 inline constexpr bool is_pointer_v<_Tp* volatile> =
true;
3561template <
typename _Tp>
3562 inline constexpr bool is_pointer_v<_Tp* const volatile> =
true;
3565template <
typename _Tp>
3566 inline constexpr bool is_lvalue_reference_v =
false;
3567template <
typename _Tp>
3568 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3569template <
typename _Tp>
3570 inline constexpr bool is_rvalue_reference_v =
false;
3571template <
typename _Tp>
3572 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3574#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3575template <
typename _Tp>
3576 inline constexpr bool is_member_object_pointer_v =
3577 __is_member_object_pointer(_Tp);
3579template <
typename _Tp>
3580 inline constexpr bool is_member_object_pointer_v =
3584#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3585template <
typename _Tp>
3586 inline constexpr bool is_member_function_pointer_v =
3587 __is_member_function_pointer(_Tp);
3589template <
typename _Tp>
3590 inline constexpr bool is_member_function_pointer_v =
3594#if __cpp_impl_reflection >= 202506L
3595template <
typename _Tp>
3596 inline constexpr bool is_reflection_v =
false;
3598 inline constexpr bool is_reflection_v<
decltype(^^int)> =
true;
3600 inline constexpr bool is_reflection_v<
const decltype(^^int)> =
true;
3602 inline constexpr bool is_reflection_v<
volatile decltype(^^int)> =
true;
3604 inline constexpr bool is_reflection_v<
const volatile decltype(^^int)> =
true;
3607template <
typename _Tp>
3608 inline constexpr bool is_enum_v = __is_enum(_Tp);
3609template <
typename _Tp>
3610 inline constexpr bool is_union_v = __is_union(_Tp);
3611template <
typename _Tp>
3612 inline constexpr bool is_class_v = __is_class(_Tp);
3615#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3616template <
typename _Tp>
3617 inline constexpr bool is_reference_v = __is_reference(_Tp);
3619template <
typename _Tp>
3620 inline constexpr bool is_reference_v =
false;
3621template <
typename _Tp>
3622 inline constexpr bool is_reference_v<_Tp&> =
true;
3623template <
typename _Tp>
3624 inline constexpr bool is_reference_v<_Tp&&> =
true;
3627template <
typename _Tp>
3629template <
typename _Tp>
3632#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3633template <
typename _Tp>
3634 inline constexpr bool is_object_v = __is_object(_Tp);
3636template <
typename _Tp>
3640template <
typename _Tp>
3642template <
typename _Tp>
3643 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3645#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3646template <
typename _Tp>
3647 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3649template <
typename _Tp>
3653#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
3654template <
typename _Tp>
3655 inline constexpr bool is_const_v = __is_const(_Tp);
3657template <
typename _Tp>
3658 inline constexpr bool is_const_v =
false;
3659template <
typename _Tp>
3660 inline constexpr bool is_const_v<const _Tp> =
true;
3663#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3664template <
typename _Tp>
3665 inline constexpr bool is_function_v = __is_function(_Tp);
3667template <
typename _Tp>
3668 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3669template <
typename _Tp>
3670 inline constexpr bool is_function_v<_Tp&> =
false;
3671template <
typename _Tp>
3672 inline constexpr bool is_function_v<_Tp&&> =
false;
3675#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
3676template <
typename _Tp>
3677 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
3679template <
typename _Tp>
3680 inline constexpr bool is_volatile_v =
false;
3681template <
typename _Tp>
3682 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3685template <
typename _Tp>
3686 _GLIBCXX26_DEPRECATED_SUGGEST(
"is_trivially_default_constructible_v && is_trivially_copyable_v")
3687 inline constexpr
bool is_trivial_v = __is_trivial(_Tp);
3688template <typename _Tp>
3689 inline constexpr
bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3690template <typename _Tp>
3691 inline constexpr
bool is_standard_layout_v = __is_standard_layout(_Tp);
3692template <typename _Tp>
3693 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3694 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3695template <typename _Tp>
3696 _GLIBCXX17_DEPRECATED
3697 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3698template <typename _Tp>
3699 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3700template <typename _Tp>
3701 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3702template <typename _Tp>
3703 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3704template <typename _Tp>
3705 inline constexpr
bool is_final_v = __is_final(_Tp);
3707template <typename _Tp>
3708 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3709template <typename _Tp>
3710 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3712template <typename _Tp, typename... _Args>
3713 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3714template <typename _Tp>
3715 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3716template <typename _Tp>
3717 inline constexpr
bool is_copy_constructible_v
3718 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3719template <typename _Tp>
3720 inline constexpr
bool is_move_constructible_v
3721 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3723template <typename _Tp, typename _Up>
3724 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3725template <typename _Tp>
3726 inline constexpr
bool is_copy_assignable_v
3727 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3728template <typename _Tp>
3729 inline constexpr
bool is_move_assignable_v
3730 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3732#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_destructible)
3733template <
typename _Tp>
3734 inline constexpr bool is_destructible_v = __is_destructible(_Tp);
3736template <
typename _Tp>
3740template <
typename _Tp,
typename... _Args>
3741 inline constexpr bool is_trivially_constructible_v
3742 = __is_trivially_constructible(_Tp, _Args...);
3743template <
typename _Tp>
3744 inline constexpr bool is_trivially_default_constructible_v
3745 = __is_trivially_constructible(_Tp);
3746template <
typename _Tp>
3747 inline constexpr bool is_trivially_copy_constructible_v
3748 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3749template <
typename _Tp>
3750 inline constexpr bool is_trivially_move_constructible_v
3751 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3753template <
typename _Tp,
typename _Up>
3754 inline constexpr bool is_trivially_assignable_v
3755 = __is_trivially_assignable(_Tp, _Up);
3756template <
typename _Tp>
3757 inline constexpr bool is_trivially_copy_assignable_v
3758 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3759 __add_lval_ref_t<const _Tp>);
3760template <
typename _Tp>
3761 inline constexpr bool is_trivially_move_assignable_v
3762 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3763 __add_rval_ref_t<_Tp>);
3765#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_trivially_destructible)
3766template <
typename _Tp>
3767 inline constexpr bool is_trivially_destructible_v
3768 = __is_trivially_destructible(_Tp);
3770template <
typename _Tp>
3771 inline constexpr bool is_trivially_destructible_v =
false;
3773template <
typename _Tp>
3774 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3775 inline constexpr bool is_trivially_destructible_v<_Tp>
3776 = __has_trivial_destructor(_Tp);
3777template <
typename _Tp>
3778 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3779template <
typename _Tp>
3780 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3781template <
typename _Tp,
size_t _Nm>
3782 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3783 = is_trivially_destructible_v<_Tp>;
3785template <
typename _Tp>
3786 inline constexpr bool is_trivially_destructible_v =
3790template <
typename _Tp,
typename... _Args>
3791 inline constexpr bool is_nothrow_constructible_v
3792 = __is_nothrow_constructible(_Tp, _Args...);
3793template <
typename _Tp>
3794 inline constexpr bool is_nothrow_default_constructible_v
3795 = __is_nothrow_constructible(_Tp);
3796template <
typename _Tp>
3797 inline constexpr bool is_nothrow_copy_constructible_v
3798 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3799template <
typename _Tp>
3800 inline constexpr bool is_nothrow_move_constructible_v
3801 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3803template <
typename _Tp,
typename _Up>
3804 inline constexpr bool is_nothrow_assignable_v
3805 = __is_nothrow_assignable(_Tp, _Up);
3806template <
typename _Tp>
3807 inline constexpr bool is_nothrow_copy_assignable_v
3808 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3809 __add_lval_ref_t<const _Tp>);
3810template <
typename _Tp>
3811 inline constexpr bool is_nothrow_move_assignable_v
3812 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3814#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_destructible)
3815template <
typename _Tp>
3816 inline constexpr bool is_nothrow_destructible_v
3817 = __is_nothrow_destructible(_Tp);
3819template <
typename _Tp>
3820 inline constexpr bool is_nothrow_destructible_v =
3824template <
typename _Tp>
3825 inline constexpr bool has_virtual_destructor_v
3826 = __has_virtual_destructor(_Tp);
3828template <
typename _Tp>
3829 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3831#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank) \
3832 && (!defined(__clang__) || __clang_major__ >= 20)
3833template <
typename _Tp>
3834 inline constexpr size_t rank_v = __array_rank(_Tp);
3836template <
typename _Tp>
3837 inline constexpr size_t rank_v = 0;
3838template <
typename _Tp,
size_t _Size>
3839 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3840template <
typename _Tp>
3841 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3844template <
typename _Tp,
unsigned _Idx = 0>
3845 inline constexpr size_t extent_v = 0;
3846template <
typename _Tp,
size_t _Size>
3847 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3848template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3849 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3850template <
typename _Tp>
3851 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3852template <
typename _Tp,
unsigned _Idx>
3853 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3855#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3856template <
typename _Tp,
typename _Up>
3857 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3859template <
typename _Tp,
typename _Up>
3860 inline constexpr bool is_same_v =
false;
3861template <
typename _Tp>
3862 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3864template <
typename _Base,
typename _Derived>
3865 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3866#ifdef __cpp_lib_is_virtual_base_of
3867template <
typename _Base,
typename _Derived>
3868 inline constexpr bool is_virtual_base_of_v = __builtin_is_virtual_base_of(_Base, _Derived);
3870#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3871template <
typename _From,
typename _To>
3872 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3874template <
typename _From,
typename _To>
3875 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3877template<
typename _Fn,
typename... _Args>
3878 inline constexpr bool is_invocable_v
3879#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3880 = __is_invocable(_Fn, _Args...);
3882 = is_invocable<_Fn, _Args...>::value;
3884template<
typename _Fn,
typename... _Args>
3885 inline constexpr bool is_nothrow_invocable_v
3886#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3887 = __is_nothrow_invocable(_Fn, _Args...);
3889 = is_nothrow_invocable<_Fn, _Args...>::value;
3891template<
typename _Ret,
typename _Fn,
typename... _Args>
3892 inline constexpr bool is_invocable_r_v
3893 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3894template<
typename _Ret,
typename _Fn,
typename... _Args>
3895 inline constexpr bool is_nothrow_invocable_r_v
3896 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3900#ifdef __cpp_lib_has_unique_object_representations
3903 template<typename _Tp>
3904 struct has_unique_object_representations
3905 : bool_constant<__has_unique_object_representations(
3906 remove_cv_t<remove_all_extents_t<_Tp>>
3909 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3910 "template argument must be a complete class or an unbounded array");
3913# if __cpp_lib_type_trait_variable_templates
3915 template<typename _Tp>
3916 inline constexpr bool has_unique_object_representations_v
3917 = has_unique_object_representations<_Tp>::value;
3921#ifdef __cpp_lib_is_aggregate
3924 template<typename _Tp>
3926 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3929# if __cpp_lib_type_trait_variable_templates
3934 template<
typename _Tp>
3935 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3939#if __cpp_lib_is_structural >= 202603L
3942 template<typename _Tp>
3943 struct is_structural
3944 : bool_constant<__builtin_is_structural(_Tp)>
3951 template<
typename _Tp>
3952 inline constexpr bool is_structural_v
3953 = __builtin_is_structural(_Tp);
3960#ifdef __cpp_lib_remove_cvref
3961# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3962 template<
typename _Tp>
3964 {
using type = __remove_cvref(_Tp); };
3966 template<
typename _Tp>
3968 {
using type =
typename remove_cv<_Tp>::type; };
3970 template<
typename _Tp>
3971 struct remove_cvref<_Tp&>
3972 {
using type =
typename remove_cv<_Tp>::type; };
3974 template<
typename _Tp>
3975 struct remove_cvref<_Tp&&>
3976 {
using type =
typename remove_cv<_Tp>::type; };
3979 template<
typename _Tp>
3980 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3984#ifdef __cpp_lib_unwrap_ref
3989 template<
typename _Tp>
3990 struct unwrap_reference {
using type = _Tp; };
3992 template<
typename _Tp>
3995 template<
typename _Tp>
3996 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
4003 template<
typename _Tp>
4004 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
4006 template<
typename _Tp>
4007 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
4011#ifdef __cpp_lib_bounded_array_traits
4015# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
4016 template<
typename _Tp>
4017 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
4019 template<
typename _Tp>
4020 inline constexpr bool is_bounded_array_v =
false;
4022 template<
typename _Tp,
size_t _Size>
4023 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
4029# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
4030 template<
typename _Tp>
4031 inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
4033 template<
typename _Tp>
4034 inline constexpr bool is_unbounded_array_v =
false;
4036 template<
typename _Tp>
4037 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
4042 template<
typename _Tp>
4043 struct is_bounded_array
4044 :
public bool_constant<is_bounded_array_v<_Tp>>
4049 template<
typename _Tp>
4050 struct is_unbounded_array
4051 :
public bool_constant<is_unbounded_array_v<_Tp>>
4055#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
4058 template<
typename _Tp,
typename _Up>
4060 : bool_constant<__is_layout_compatible(_Tp, _Up)>
4065 template<
typename _Tp,
typename _Up>
4067 = __is_layout_compatible(_Tp, _Up);
4069#if __has_builtin(__builtin_is_corresponding_member)
4070# ifndef __cpp_lib_is_layout_compatible
4071# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
4075 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
4078 {
return __builtin_is_corresponding_member(__m1, __m2); }
4082#if __has_builtin(__is_pointer_interconvertible_base_of) \
4083 && __cplusplus >= 202002L
4086 template<
typename _Base,
typename _Derived>
4088 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
4093 template<
typename _Base,
typename _Derived>
4095 = __is_pointer_interconvertible_base_of(_Base, _Derived);
4097#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
4098# ifndef __cpp_lib_is_pointer_interconvertible
4099# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
4105 template<
typename _Tp,
typename _Mem>
4108 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
4112#ifdef __cpp_lib_is_scoped_enum
4116# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4117 template<
typename _Tp>
4118 struct is_scoped_enum
4119 : bool_constant<__is_scoped_enum(_Tp)>
4122 template<
typename _Tp>
4123 struct is_scoped_enum
4127 template<
typename _Tp>
4128 requires __is_enum(_Tp)
4129 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
4130 struct is_scoped_enum<_Tp>
4131 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
4137# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
4138 template<
typename _Tp>
4139 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
4141 template<
typename _Tp>
4142 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
4146#ifdef __cpp_lib_is_implicit_lifetime
4150 template<
typename _Tp>
4151 struct is_implicit_lifetime
4152 : bool_constant<__builtin_is_implicit_lifetime(_Tp)>
4157 template<
typename _Tp>
4158 inline constexpr bool is_implicit_lifetime_v
4159 = __builtin_is_implicit_lifetime(_Tp);
4162#ifdef __cpp_lib_reference_from_temporary
4167 template<typename _Tp, typename _Up>
4168 struct reference_constructs_from_temporary
4169 :
public bool_constant<__reference_constructs_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");
4180 template<
typename _Tp,
typename _Up>
4181 struct reference_converts_from_temporary
4182 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
4184 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
4185 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
4186 "template argument must be a complete class or an unbounded array");
4191 template<
typename _Tp,
typename _Up>
4192 inline constexpr bool reference_constructs_from_temporary_v
4193 = reference_constructs_from_temporary<_Tp, _Up>::value;
4197 template<
typename _Tp,
typename _Up>
4198 inline constexpr bool reference_converts_from_temporary_v
4199 = reference_converts_from_temporary<_Tp, _Up>::value;
4202#ifdef __cpp_lib_is_constant_evaluated
4205 [[__gnu__::__always_inline__]]
4207 is_constant_evaluated() noexcept
4209#if __cpp_if_consteval >= 202106L
4210 if consteval {
return true; }
else {
return false; }
4212 return __builtin_is_constant_evaluated();
4217#if __cplusplus >= 202002L
4219 template<
typename _From,
typename _To>
4220 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
4222 template<
typename _Xp,
typename _Yp>
4226 template<
typename _Ap,
typename _Bp,
typename =
void>
4227 struct __common_ref_impl
4231 template<
typename _Ap,
typename _Bp>
4232 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
4235 template<
typename _Xp,
typename _Yp>
4236 using __condres_cvref
4237 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
4240 template<
typename _Xp,
typename _Yp>
4241 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
4243 __condres_cvref<_Xp, _Yp>>
4247 template<
typename _Xp,
typename _Yp>
4251 template<
typename _Xp,
typename _Yp>
4252 struct __common_ref_impl<_Xp&&, _Yp&&,
4253 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
4254 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
4255 {
using type = __common_ref_C<_Xp, _Yp>; };
4258 template<
typename _Xp,
typename _Yp>
4259 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
4262 template<
typename _Xp,
typename _Yp>
4263 struct __common_ref_impl<_Xp&&, _Yp&,
4264 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
4265 {
using type = __common_ref_D<_Xp, _Yp>; };
4268 template<
typename _Xp,
typename _Yp>
4269 struct __common_ref_impl<_Xp&, _Yp&&>
4270 : __common_ref_impl<_Yp&&, _Xp&>
4274 template<
typename _Tp,
typename _Up,
4275 template<
typename>
class _TQual,
template<
typename>
class _UQual>
4276 struct basic_common_reference
4280 template<
typename _Tp>
4282 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
4284 template<
typename _Tp>
4286 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
4288 template<
typename _Tp>
4289 struct __xref<_Tp&&>
4290 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
4292 template<
typename _Tp1,
typename _Tp2>
4293 using __basic_common_ref
4294 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
4295 remove_cvref_t<_Tp2>,
4296 __xref<_Tp1>::template __type,
4297 __xref<_Tp2>::template __type>::type;
4300 template<
typename... _Tp>
4301 struct common_reference;
4303 template<
typename... _Tp>
4308 struct common_reference<>
4312 template<
typename _Tp0>
4313 struct common_reference<_Tp0>
4314 {
using type = _Tp0; };
4317 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1>
4318 struct __common_reference_impl
4319 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
4323 template<
typename _Tp1,
typename _Tp2>
4324 struct common_reference<_Tp1, _Tp2>
4325 : __common_reference_impl<_Tp1, _Tp2>
4329 template<
typename _Tp1,
typename _Tp2>
4330 requires is_reference_v<_Tp1> && is_reference_v<_Tp2>
4331 &&
requires {
typename __common_ref<_Tp1, _Tp2>; }
4332#if __cpp_lib_common_reference
4333 && is_convertible_v<add_pointer_t<_Tp1>,
4335 && is_convertible_v<add_pointer_t<_Tp2>,
4338 struct __common_reference_impl<_Tp1, _Tp2, 1>
4339 {
using type = __common_ref<_Tp1, _Tp2>; };
4342 template<
typename _Tp1,
typename _Tp2>
4343 requires requires {
typename __basic_common_ref<_Tp1, _Tp2>; }
4344 struct __common_reference_impl<_Tp1, _Tp2, 2>
4345 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
4348 template<
typename _Tp1,
typename _Tp2>
4349 requires requires {
typename __cond_res<_Tp1, _Tp2>; }
4350 struct __common_reference_impl<_Tp1, _Tp2, 3>
4351 {
using type = __cond_res<_Tp1, _Tp2>; };
4354 template<
typename _Tp1,
typename _Tp2>
4356 struct __common_reference_impl<_Tp1, _Tp2, 4>
4357 {
using type = common_type_t<_Tp1, _Tp2>; };
4360 template<
typename _Tp1,
typename _Tp2>
4361 struct __common_reference_impl<_Tp1, _Tp2, 5>
4365 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4366 struct common_reference<_Tp1, _Tp2, _Rest...>
4367 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4368 __common_type_pack<_Rest...>>
4372 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4373 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4374 __common_type_pack<_Rest...>,
4376 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4382#if __cplusplus >= 201103L
4385 template<
size_t... _Indexes>
struct _Index_tuple { };
4388 template<
size_t _Num>
4389 struct _Build_index_tuple
4391#if __has_builtin(__make_integer_seq)
4392 template<
typename,
size_t... _Indices>
4393 using _IdxTuple = _Index_tuple<_Indices...>;
4396 using __type = __make_integer_seq<_IdxTuple, size_t, _Num>;
4399 using __type = _Index_tuple<__integer_pack(_Num)...>;
4404#if __cpp_lib_within_lifetime >= 202603L
4405 template<
typename _Up =
void,
typename _Tp>
4407 is_within_lifetime(
const _Tp* __p)
noexcept
4409 return (__builtin_is_within_lifetime (__p)
4410 && __builtin_constant_p(
static_cast<const volatile _Up*
>(__p)
4415#if __glibcxx_apply >= 202506L
4416 template<
typename _Fn,
typename _Tuple>
4420 template<
typename _Fn,
typename _Tuple>
4421 requires (!is_same_v<remove_cv_t<
decltype(__unpack_tuple_like_impl<__invoke_result, _Fn, _Tuple>)>,
false_type>)
4422 struct apply_result<_Fn, _Tuple>
4423 : remove_cv_t<decltype(__unpack_tuple_like_impl<__invoke_result, _Fn, _Tuple>)>
4426 template<
typename _Fn,
typename _Tuple>
4429 template<
typename _Fn,
typename _Tuple>
4430 struct is_applicable
4431 : remove_cv_t<decltype(__unpack_tuple_like_impl<is_invocable, _Fn, _Tuple>)>
4434 template<
typename _Fn,
typename _Tuple>
4435 struct is_nothrow_applicable
4436 : bool_constant<__noexcept_unpack_tuple_like_v<is_nothrow_invocable, _Fn, _Tuple>>
4439 template<
typename _Fn,
typename _Tuple>
4441 = __unpack_tuple_like_v<is_invocable, _Fn, _Tuple>;
4443 template<
typename _Fn,
typename _Tuple>
4445 = __noexcept_unpack_tuple_like_v<is_nothrow_invocable, _Fn, _Tuple>;
4450_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.
constexpr bool is_nothrow_applicable_v
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 apply_result< _Fn, _Tuple >::type apply_result_t
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
constexpr bool is_applicable_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.