29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
40#define __glibcxx_want_bool_constant
41#define __glibcxx_want_bounded_array_traits
42#define __glibcxx_want_has_unique_object_representations
43#define __glibcxx_want_integral_constant_callable
44#define __glibcxx_want_is_aggregate
45#define __glibcxx_want_is_constant_evaluated
46#define __glibcxx_want_is_final
47#define __glibcxx_want_is_invocable
48#define __glibcxx_want_is_layout_compatible
49#define __glibcxx_want_is_nothrow_convertible
50#define __glibcxx_want_is_null_pointer
51#define __glibcxx_want_is_pointer_interconvertible
52#define __glibcxx_want_is_scoped_enum
53#define __glibcxx_want_is_swappable
54#define __glibcxx_want_logical_traits
55#define __glibcxx_want_reference_from_temporary
56#define __glibcxx_want_remove_cvref
57#define __glibcxx_want_result_of_sfinae
58#define __glibcxx_want_transformation_trait_aliases
59#define __glibcxx_want_type_identity
60#define __glibcxx_want_type_trait_variable_templates
61#define __glibcxx_want_unwrap_ref
62#define __glibcxx_want_void_t
67namespace std _GLIBCXX_VISIBILITY(default)
69_GLIBCXX_BEGIN_NAMESPACE_VERSION
71 template<
typename _Tp>
72 class reference_wrapper;
88 template<
typename _Tp, _Tp __v>
91 static constexpr _Tp value = __v;
92 using value_type = _Tp;
94 constexpr operator value_type()
const noexcept {
return value; }
96#ifdef __cpp_lib_integral_constant_callable
97 constexpr value_type operator()()
const noexcept {
return value; }
101#if ! __cpp_inline_variables
102 template<
typename _Tp, _Tp __v>
118#ifdef __cpp_lib_bool_constant
122 using bool_constant = __bool_constant<__v>;
129 template<
bool,
typename _Tp =
void>
134 template<
typename _Tp>
136 {
using type = _Tp; };
139 template<
bool _Cond,
typename _Tp =
void>
140 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
145 template<
typename _Tp,
typename>
150 struct __conditional<false>
152 template<
typename,
typename _Up>
157 template<
bool _Cond,
typename _If,
typename _Else>
158 using __conditional_t
159 =
typename __conditional<_Cond>::template type<_If, _Else>;
162 template <
typename _Type>
163 struct __type_identity
164 {
using type = _Type; };
166 template<
typename _Tp>
167 using __type_identity_t =
typename __type_identity<_Tp>::type;
172 template<
typename _Tp,
typename...>
173 using __first_t = _Tp;
176 template<
typename... _Bn>
178 __enable_if_t<!bool(_Bn::value)>...>;
180 template<
typename... _Bn>
183 template<
typename... _Bn>
184 auto __and_fn(
int) -> __first_t<
true_type,
185 __enable_if_t<bool(_Bn::value)>...>;
187 template<
typename... _Bn>
194 template<
typename... _Bn>
196 : decltype(__detail::__or_fn<_Bn...>(0))
199 template<
typename... _Bn>
201 : decltype(__detail::__and_fn<_Bn...>(0))
204 template<
typename _Pp>
206 : __bool_constant<!bool(_Pp::value)>
210#ifdef __cpp_lib_logical_traits
213 template<
typename... _Bn>
214 inline constexpr bool __or_v = __or_<_Bn...>::value;
215 template<
typename... _Bn>
216 inline constexpr bool __and_v = __and_<_Bn...>::value;
220 template<
typename ,
typename _B1,
typename... _Bn>
221 struct __disjunction_impl
222 {
using type = _B1; };
224 template<
typename _B1,
typename _B2,
typename... _Bn>
225 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
226 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
228 template<
typename ,
typename _B1,
typename... _Bn>
229 struct __conjunction_impl
230 {
using type = _B1; };
232 template<
typename _B1,
typename _B2,
typename... _Bn>
233 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
234 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
238 template<
typename... _Bn>
240 : __detail::__conjunction_impl<void, _Bn...>::type
248 template<
typename... _Bn>
250 : __detail::__disjunction_impl<void, _Bn...>::type
258 template<
typename _Pp>
266 template<
typename... _Bn>
267 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
269 template<
typename... _Bn>
270 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
272 template<
typename _Pp>
273 inline constexpr bool negation_v = negation<_Pp>::value;
292 struct __is_array_unknown_bounds;
297 template <
typename _Tp,
size_t = sizeof(_Tp)>
298 constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
301 template <
typename _TypeIdentity,
302 typename _NestedType =
typename _TypeIdentity::type>
303 constexpr typename __or_<
304 is_reference<_NestedType>,
305 is_function<_NestedType>,
306 is_void<_NestedType>,
307 __is_array_unknown_bounds<_NestedType>
308 >::type __is_complete_or_unbounded(_TypeIdentity)
312 template<
typename _Tp>
313 using __remove_cv_t =
typename remove_cv<_Tp>::type;
319 template<
typename _Tp>
328 struct is_void<const void>
332 struct is_void<volatile void>
336 struct is_void<const volatile void>
341 struct __is_integral_helper
345 struct __is_integral_helper<bool>
349 struct __is_integral_helper<char>
353 struct __is_integral_helper<signed char>
357 struct __is_integral_helper<unsigned char>
364 struct __is_integral_helper<wchar_t>
367#ifdef _GLIBCXX_USE_CHAR8_T
369 struct __is_integral_helper<char8_t>
374 struct __is_integral_helper<char16_t>
378 struct __is_integral_helper<char32_t>
382 struct __is_integral_helper<short>
386 struct __is_integral_helper<unsigned short>
390 struct __is_integral_helper<int>
394 struct __is_integral_helper<unsigned int>
398 struct __is_integral_helper<long>
402 struct __is_integral_helper<unsigned long>
406 struct __is_integral_helper<long long>
410 struct __is_integral_helper<unsigned long long>
415#if defined(__GLIBCXX_TYPE_INT_N_0)
418 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
423 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
426#if defined(__GLIBCXX_TYPE_INT_N_1)
429 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
434 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
437#if defined(__GLIBCXX_TYPE_INT_N_2)
440 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
445 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
448#if defined(__GLIBCXX_TYPE_INT_N_3)
451 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
456 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
462 template<
typename _Tp>
464 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
469 struct __is_floating_point_helper
473 struct __is_floating_point_helper<float>
477 struct __is_floating_point_helper<double>
481 struct __is_floating_point_helper<long double>
484#ifdef __STDCPP_FLOAT16_T__
486 struct __is_floating_point_helper<_Float16>
490#ifdef __STDCPP_FLOAT32_T__
492 struct __is_floating_point_helper<_Float32>
496#ifdef __STDCPP_FLOAT64_T__
498 struct __is_floating_point_helper<_Float64>
502#ifdef __STDCPP_FLOAT128_T__
504 struct __is_floating_point_helper<_Float128>
508#ifdef __STDCPP_BFLOAT16_T__
510 struct __is_floating_point_helper<
__gnu_cxx::__bfloat16_t>
514#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
516 struct __is_floating_point_helper<__float128>
522 template<
typename _Tp>
524 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
528#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
529 template<
typename _Tp>
531 :
public __bool_constant<__is_array(_Tp)>
538 template<
typename _Tp, std::
size_t _Size>
542 template<
typename _Tp>
543 struct is_array<_Tp[]>
548#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
549 template<
typename _Tp>
551 :
public __bool_constant<__is_pointer(_Tp)>
554 template<
typename _Tp>
558 template<
typename _Tp>
562 template<
typename _Tp>
563 struct is_pointer<_Tp*
const>
566 template<
typename _Tp>
567 struct is_pointer<_Tp*
volatile>
570 template<
typename _Tp>
571 struct is_pointer<_Tp*
const volatile>
580 template<
typename _Tp>
589 template<
typename _Tp>
594#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
595 template<
typename _Tp>
596 struct is_member_object_pointer
597 :
public __bool_constant<__is_member_object_pointer(_Tp)>
604 template<
typename _Tp,
typename _Cp>
606 :
public __not_<is_function<_Tp>>::type { };
609 template<
typename _Tp>
610 struct is_member_object_pointer
611 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
615#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
617 template<
typename _Tp>
618 struct is_member_function_pointer
619 :
public __bool_constant<__is_member_function_pointer(_Tp)>
623 struct __is_member_function_pointer_helper
626 template<
typename _Tp,
typename _Cp>
627 struct __is_member_function_pointer_helper<_Tp _Cp::*>
628 :
public is_function<_Tp>::type { };
631 template<
typename _Tp>
633 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
638 template<
typename _Tp>
640 :
public __bool_constant<__is_enum(_Tp)>
644 template<
typename _Tp>
646 :
public __bool_constant<__is_union(_Tp)>
650 template<
typename _Tp>
652 :
public __bool_constant<__is_class(_Tp)>
656#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
657 template<
typename _Tp>
659 :
public __bool_constant<__is_function(_Tp)>
662 template<
typename _Tp>
664 :
public __bool_constant<!is_const<const _Tp>::value> { };
666 template<
typename _Tp>
670 template<
typename _Tp>
671 struct is_function<_Tp&&>
675#ifdef __cpp_lib_is_null_pointer
677 template<typename _Tp>
678 struct is_null_pointer
682 struct is_null_pointer<
std::nullptr_t>
686 struct is_null_pointer<const
std::nullptr_t>
690 struct is_null_pointer<volatile
std::nullptr_t>
694 struct is_null_pointer<const volatile
std::nullptr_t>
699 template<
typename _Tp>
700 struct __is_nullptr_t
701 :
public is_null_pointer<_Tp>
702 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
708#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
709 template<
typename _Tp>
711 :
public __bool_constant<__is_reference(_Tp)>
714 template<
typename _Tp>
719 template<
typename _Tp>
724 template<
typename _Tp>
725 struct is_reference<_Tp&&>
731 template<
typename _Tp>
733 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
737 template<
typename _Tp>
739 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
740 is_null_pointer<_Tp>>::type
744#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
745 template<
typename _Tp>
747 :
public __bool_constant<__is_object(_Tp)>
750 template<
typename _Tp>
752 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
761 template<
typename _Tp>
763 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
764 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
768 template<
typename _Tp>
770 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
773#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
774 template<
typename _Tp>
776 :
public __bool_constant<__is_member_pointer(_Tp)>
780 template<
typename _Tp>
781 struct __is_member_pointer_helper
784 template<
typename _Tp,
typename _Cp>
785 struct __is_member_pointer_helper<_Tp _Cp::*>
789 template<
typename _Tp>
791 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
795 template<
typename,
typename>
799 template<
typename _Tp,
typename... _Types>
800 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
804 template<
typename _Tp>
805 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
806 signed char,
signed short,
signed int,
signed long,
808#if defined(__GLIBCXX_TYPE_INT_N_0)
809 ,
signed __GLIBCXX_TYPE_INT_N_0
811#if defined(__GLIBCXX_TYPE_INT_N_1)
812 ,
signed __GLIBCXX_TYPE_INT_N_1
814#if defined(__GLIBCXX_TYPE_INT_N_2)
815 ,
signed __GLIBCXX_TYPE_INT_N_2
817#if defined(__GLIBCXX_TYPE_INT_N_3)
818 ,
signed __GLIBCXX_TYPE_INT_N_3
824 template<
typename _Tp>
825 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
826 unsigned char,
unsigned short,
unsigned int,
unsigned long,
828#if defined(__GLIBCXX_TYPE_INT_N_0)
829 ,
unsigned __GLIBCXX_TYPE_INT_N_0
831#if defined(__GLIBCXX_TYPE_INT_N_1)
832 ,
unsigned __GLIBCXX_TYPE_INT_N_1
834#if defined(__GLIBCXX_TYPE_INT_N_2)
835 ,
unsigned __GLIBCXX_TYPE_INT_N_2
837#if defined(__GLIBCXX_TYPE_INT_N_3)
838 ,
unsigned __GLIBCXX_TYPE_INT_N_3
843 template<
typename _Tp>
844 using __is_standard_integer
845 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
848 template<
typename...>
using __void_t = void;
854#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
855 template<
typename _Tp>
857 :
public __bool_constant<__is_const(_Tp)>
864 template<
typename _Tp>
870#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
871 template<
typename _Tp>
873 :
public __bool_constant<__is_volatile(_Tp)>
880 template<
typename _Tp>
886 template<
typename _Tp>
888 :
public __bool_constant<__is_trivial(_Tp)>
890 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
891 "template argument must be a complete class or an unbounded array");
895 template<
typename _Tp>
897 :
public __bool_constant<__is_trivially_copyable(_Tp)>
899 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
900 "template argument must be a complete class or an unbounded array");
904 template<
typename _Tp>
906 :
public __bool_constant<__is_standard_layout(_Tp)>
908 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
909 "template argument must be a complete class or an unbounded array");
917 template<
typename _Tp>
919 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
921 : public __bool_constant<__is_pod(_Tp)>
923 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
924 "template argument must be a complete class or an unbounded array");
931 template<
typename _Tp>
933 _GLIBCXX17_DEPRECATED
935 :
public __bool_constant<__is_literal_type(_Tp)>
937 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
938 "template argument must be a complete class or an unbounded array");
942 template<
typename _Tp>
944 :
public __bool_constant<__is_empty(_Tp)>
948 template<
typename _Tp>
950 :
public __bool_constant<__is_polymorphic(_Tp)>
953#ifdef __cpp_lib_is_final
956 template<typename _Tp>
958 :
public __bool_constant<__is_final(_Tp)>
963 template<
typename _Tp>
965 :
public __bool_constant<__is_abstract(_Tp)>
969 template<
typename _Tp,
971 struct __is_signed_helper
974 template<
typename _Tp>
975 struct __is_signed_helper<_Tp, true>
976 :
public __bool_constant<_Tp(-1) < _Tp(0)>
981 template<typename _Tp>
983 : public __is_signed_helper<_Tp>::type
987 template<typename _Tp>
989 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
993 template<typename _Tp, typename _Up = _Tp&&>
997 template<typename _Tp>
1002 template<typename _Tp>
1003 auto declval() noexcept -> decltype(__declval<_Tp>(0));
1009 template<typename _Tp>
1010 struct __is_array_known_bounds
1014 template<
typename _Tp,
size_t _Size>
1015 struct __is_array_known_bounds<_Tp[_Size]>
1019 template<
typename _Tp>
1020 struct __is_array_unknown_bounds
1024 template<
typename _Tp>
1025 struct __is_array_unknown_bounds<_Tp[]>
1036 struct __do_is_destructible_impl
1038 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1039 static true_type __test(
int);
1045 template<
typename _Tp>
1046 struct __is_destructible_impl
1047 :
public __do_is_destructible_impl
1049 using type =
decltype(__test<_Tp>(0));
1052 template<
typename _Tp,
1053 bool = __or_<is_void<_Tp>,
1054 __is_array_unknown_bounds<_Tp>,
1055 is_function<_Tp>>::value,
1056 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
1057 struct __is_destructible_safe;
1059 template<
typename _Tp>
1060 struct __is_destructible_safe<_Tp, false, false>
1061 :
public __is_destructible_impl<typename
1062 remove_all_extents<_Tp>::type>::type
1065 template<
typename _Tp>
1066 struct __is_destructible_safe<_Tp, true, false>
1069 template<
typename _Tp>
1070 struct __is_destructible_safe<_Tp, false, true>
1075 template<
typename _Tp>
1077 :
public __is_destructible_safe<_Tp>::type
1079 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1080 "template argument must be a complete class or an unbounded array");
1089 struct __do_is_nt_destructible_impl
1091 template<
typename _Tp>
1092 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1099 template<
typename _Tp>
1100 struct __is_nt_destructible_impl
1101 :
public __do_is_nt_destructible_impl
1103 using type =
decltype(__test<_Tp>(0));
1106 template<
typename _Tp,
1107 bool = __or_<is_void<_Tp>,
1108 __is_array_unknown_bounds<_Tp>,
1109 is_function<_Tp>>::value,
1110 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
1111 struct __is_nt_destructible_safe;
1113 template<
typename _Tp>
1114 struct __is_nt_destructible_safe<_Tp, false, false>
1115 :
public __is_nt_destructible_impl<typename
1116 remove_all_extents<_Tp>::type>::type
1119 template<
typename _Tp>
1120 struct __is_nt_destructible_safe<_Tp, true, false>
1123 template<
typename _Tp>
1124 struct __is_nt_destructible_safe<_Tp, false, true>
1129 template<
typename _Tp>
1131 :
public __is_nt_destructible_safe<_Tp>::type
1133 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1134 "template argument must be a complete class or an unbounded array");
1138 template<
typename _Tp,
typename... _Args>
1139 using __is_constructible_impl
1140 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1144 template<
typename _Tp,
typename... _Args>
1146 :
public __is_constructible_impl<_Tp, _Args...>
1148 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1149 "template argument must be a complete class or an unbounded array");
1153 template<
typename _Tp>
1155 :
public __is_constructible_impl<_Tp>
1157 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1158 "template argument must be a complete class or an unbounded array");
1162#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_lvalue_reference)
1163 template<
typename _Tp>
1164 using __add_lval_ref_t = __add_lvalue_reference(_Tp);
1166 template<
typename _Tp,
typename =
void>
1167 struct __add_lvalue_reference_helper
1168 {
using type = _Tp; };
1170 template<
typename _Tp>
1171 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1172 {
using type = _Tp&; };
1174 template<
typename _Tp>
1175 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1180 template<
typename _Tp>
1182 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1184 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1185 "template argument must be a complete class or an unbounded array");
1189#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_rvalue_reference)
1190 template<
typename _Tp>
1191 using __add_rval_ref_t = __add_rvalue_reference(_Tp);
1193 template<
typename _Tp,
typename =
void>
1194 struct __add_rvalue_reference_helper
1195 {
using type = _Tp; };
1197 template<
typename _Tp>
1198 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1199 {
using type = _Tp&&; };
1201 template<
typename _Tp>
1202 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1207 template<
typename _Tp>
1209 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1211 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1212 "template argument must be a complete class or an unbounded array");
1216 template<
typename _Tp,
typename... _Args>
1217 using __is_nothrow_constructible_impl
1218 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1222 template<
typename _Tp,
typename... _Args>
1224 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1226 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1227 "template argument must be a complete class or an unbounded array");
1231 template<
typename _Tp>
1233 :
public __is_nothrow_constructible_impl<_Tp>
1235 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1236 "template argument must be a complete class or an unbounded array");
1240 template<
typename _Tp>
1242 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1244 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1245 "template argument must be a complete class or an unbounded array");
1249 template<
typename _Tp>
1251 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1253 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1254 "template argument must be a complete class or an unbounded array");
1258 template<
typename _Tp,
typename _Up>
1259 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1263 template<
typename _Tp,
typename _Up>
1265 :
public __is_assignable_impl<_Tp, _Up>
1267 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1268 "template argument must be a complete class or an unbounded array");
1272 template<
typename _Tp>
1274 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1275 __add_lval_ref_t<const _Tp>>
1277 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1278 "template argument must be a complete class or an unbounded array");
1282 template<
typename _Tp>
1284 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1286 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1287 "template argument must be a complete class or an unbounded array");
1291 template<
typename _Tp,
typename _Up>
1292 using __is_nothrow_assignable_impl
1293 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1297 template<
typename _Tp,
typename _Up>
1299 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1301 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1302 "template argument must be a complete class or an unbounded array");
1306 template<
typename _Tp>
1308 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1309 __add_lval_ref_t<const _Tp>>
1311 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1312 "template argument must be a complete class or an unbounded array");
1316 template<
typename _Tp>
1318 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1319 __add_rval_ref_t<_Tp>>
1321 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1322 "template argument must be a complete class or an unbounded array");
1326 template<
typename _Tp,
typename... _Args>
1327 using __is_trivially_constructible_impl
1328 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1332 template<
typename _Tp,
typename... _Args>
1334 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1336 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1337 "template argument must be a complete class or an unbounded array");
1341 template<
typename _Tp>
1343 :
public __is_trivially_constructible_impl<_Tp>
1345 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1346 "template argument must be a complete class or an unbounded array");
1349#if __cpp_variable_templates && __cpp_concepts
1350 template<
typename _Tp>
1351 constexpr bool __is_implicitly_default_constructible_v
1352 =
requires (void(&__f)(_Tp)) { __f({}); };
1354 template<
typename _Tp>
1355 struct __is_implicitly_default_constructible
1356 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1359 struct __do_is_implicitly_default_constructible_impl
1361 template <
typename _Tp>
1362 static void __helper(
const _Tp&);
1364 template <
typename _Tp>
1366 decltype(__helper<const _Tp&>({}))* = 0);
1371 template<
typename _Tp>
1372 struct __is_implicitly_default_constructible_impl
1373 :
public __do_is_implicitly_default_constructible_impl
1375 using type =
decltype(__test(declval<_Tp>()));
1378 template<
typename _Tp>
1379 struct __is_implicitly_default_constructible_safe
1380 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1383 template <
typename _Tp>
1384 struct __is_implicitly_default_constructible
1385 :
public __and_<__is_constructible_impl<_Tp>,
1386 __is_implicitly_default_constructible_safe<_Tp>>::type
1391 template<
typename _Tp>
1393 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1395 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1396 "template argument must be a complete class or an unbounded array");
1400 template<
typename _Tp>
1402 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1404 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1405 "template argument must be a complete class or an unbounded array");
1409 template<
typename _Tp,
typename _Up>
1410 using __is_trivially_assignable_impl
1411 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1415 template<
typename _Tp,
typename _Up>
1417 :
public __is_trivially_assignable_impl<_Tp, _Up>
1419 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1420 "template argument must be a complete class or an unbounded array");
1424 template<
typename _Tp>
1426 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1427 __add_lval_ref_t<const _Tp>>
1429 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1430 "template argument must be a complete class or an unbounded array");
1434 template<
typename _Tp>
1436 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1437 __add_rval_ref_t<_Tp>>
1439 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1440 "template argument must be a complete class or an unbounded array");
1444 template<
typename _Tp>
1446 :
public __and_<__is_destructible_safe<_Tp>,
1447 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1449 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1450 "template argument must be a complete class or an unbounded array");
1455 template<
typename _Tp>
1457 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1459 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1460 "template argument must be a complete class or an unbounded array");
1467 template<
typename _Tp>
1471 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1472 "template argument must be a complete class or an unbounded array");
1476#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank)
1477 template<
typename _Tp>
1485 template<
typename _Tp, std::
size_t _Size>
1486 struct rank<_Tp[_Size]>
1489 template<
typename _Tp>
1491 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1495 template<
typename,
unsigned _U
int = 0>
1499 template<
typename _Tp,
size_t _Size>
1500 struct extent<_Tp[_Size], 0>
1503 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1504 struct extent<_Tp[_Size], _Uint>
1505 :
public extent<_Tp, _Uint - 1>::type { };
1507 template<
typename _Tp>
1508 struct extent<_Tp[], 0>
1509 :
public integral_constant<size_t, 0> { };
1511 template<
typename _Tp,
unsigned _U
int>
1512 struct extent<_Tp[], _Uint>
1513 :
public extent<_Tp, _Uint - 1>::type { };
1519#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1520 template<
typename _Tp,
typename _Up>
1522 :
public __bool_constant<__is_same(_Tp, _Up)>
1525 template<
typename _Tp,
typename _Up>
1530 template<
typename _Tp>
1537 template<
typename _Base,
typename _Derived>
1539 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1542#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1543 template<
typename _From,
typename _To>
1545 :
public __bool_constant<__is_convertible(_From, _To)>
1548 template<
typename _From,
typename _To,
1549 bool = __or_<is_void<_From>, is_function<_To>,
1550 is_array<_To>>::value>
1551 struct __is_convertible_helper
1553 using type =
typename is_void<_To>::type;
1556#pragma GCC diagnostic push
1557#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1558 template<
typename _From,
typename _To>
1559 class __is_convertible_helper<_From, _To, false>
1561 template<
typename _To1>
1562 static void __test_aux(_To1)
noexcept;
1564 template<
typename _From1,
typename _To1,
1565 typename =
decltype(__test_aux<_To1>(std::declval<_From1>()))>
1569 template<
typename,
typename>
1574 using type =
decltype(__test<_From, _To>(0));
1576#pragma GCC diagnostic pop
1579 template<
typename _From,
typename _To>
1581 :
public __is_convertible_helper<_From, _To>::type
1586 template<
typename _ToElementType,
typename _FromElementType>
1590#ifdef __cpp_lib_is_nothrow_convertible
1592#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1594 template<
typename _From,
typename _To>
1595 inline constexpr bool is_nothrow_convertible_v
1596 = __is_nothrow_convertible(_From, _To);
1599 template<
typename _From,
typename _To>
1600 struct is_nothrow_convertible
1601 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1604 template<
typename _From,
typename _To,
1605 bool = __or_<is_void<_From>, is_function<_To>,
1606 is_array<_To>>::value>
1607 struct __is_nt_convertible_helper
1611#pragma GCC diagnostic push
1612#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1613 template<
typename _From,
typename _To>
1614 class __is_nt_convertible_helper<_From, _To, false>
1616 template<
typename _To1>
1617 static void __test_aux(_To1)
noexcept;
1619 template<
typename _From1,
typename _To1>
1621 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1624 template<
typename,
typename>
1629 using type =
decltype(__test<_From, _To>(0));
1631#pragma GCC diagnostic pop
1634 template<
typename _From,
typename _To>
1635 struct is_nothrow_convertible
1636 :
public __is_nt_convertible_helper<_From, _To>::type
1640 template<
typename _From,
typename _To>
1641 inline constexpr bool is_nothrow_convertible_v
1642 = is_nothrow_convertible<_From, _To>::value;
1646#pragma GCC diagnostic push
1647#pragma GCC diagnostic ignored "-Wc++14-extensions"
1648 template<
typename _Tp,
typename... _Args>
1649 struct __is_nothrow_new_constructible_impl
1651 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1655 template<
typename _Tp,
typename... _Args>
1656 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1657 = __and_<is_constructible<_Tp, _Args...>,
1658 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1659#pragma GCC diagnostic pop
1664 template<
typename _Tp>
1666 {
using type = _Tp; };
1668 template<
typename _Tp>
1670 {
using type = _Tp; };
1673 template<
typename _Tp>
1675 {
using type = _Tp; };
1677 template<
typename _Tp>
1679 {
using type = _Tp; };
1682#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1683 template<
typename _Tp>
1685 {
using type = __remove_cv(_Tp); };
1687 template<
typename _Tp>
1689 {
using type = _Tp; };
1691 template<
typename _Tp>
1693 {
using type = _Tp; };
1695 template<
typename _Tp>
1696 struct remove_cv<volatile _Tp>
1697 {
using type = _Tp; };
1699 template<
typename _Tp>
1700 struct remove_cv<const volatile _Tp>
1701 {
using type = _Tp; };
1705 template<
typename _Tp>
1707 {
using type = _Tp
const; };
1710 template<
typename _Tp>
1712 {
using type = _Tp
volatile; };
1715 template<
typename _Tp>
1717 {
using type = _Tp
const volatile; };
1719#ifdef __cpp_lib_transformation_trait_aliases
1721 template<typename _Tp>
1722 using remove_const_t =
typename remove_const<_Tp>::type;
1725 template<
typename _Tp>
1726 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1729 template<
typename _Tp>
1730 using remove_cv_t =
typename remove_cv<_Tp>::type;
1733 template<
typename _Tp>
1734 using add_const_t =
typename add_const<_Tp>::type;
1737 template<
typename _Tp>
1738 using add_volatile_t =
typename add_volatile<_Tp>::type;
1741 template<
typename _Tp>
1742 using add_cv_t =
typename add_cv<_Tp>::type;
1748#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1749 template<
typename _Tp>
1751 {
using type = __remove_reference(_Tp); };
1753 template<
typename _Tp>
1755 {
using type = _Tp; };
1757 template<
typename _Tp>
1759 {
using type = _Tp; };
1761 template<
typename _Tp>
1762 struct remove_reference<_Tp&&>
1763 {
using type = _Tp; };
1767 template<
typename _Tp>
1769 {
using type = __add_lval_ref_t<_Tp>; };
1772 template<
typename _Tp>
1774 {
using type = __add_rval_ref_t<_Tp>; };
1776#if __cplusplus > 201103L
1778 template<
typename _Tp>
1782 template<
typename _Tp>
1786 template<
typename _Tp>
1795 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1796 struct __cv_selector;
1798 template<
typename _Unqualified>
1799 struct __cv_selector<_Unqualified, false, false>
1800 {
using __type = _Unqualified; };
1802 template<
typename _Unqualified>
1803 struct __cv_selector<_Unqualified, false, true>
1804 {
using __type =
volatile _Unqualified; };
1806 template<
typename _Unqualified>
1807 struct __cv_selector<_Unqualified, true, false>
1808 {
using __type =
const _Unqualified; };
1810 template<
typename _Unqualified>
1811 struct __cv_selector<_Unqualified, true, true>
1812 {
using __type =
const volatile _Unqualified; };
1814 template<
typename _Qualified,
typename _Unqualified,
1815 bool _IsConst = is_const<_Qualified>::value,
1816 bool _IsVol = is_volatile<_Qualified>::value>
1817 class __match_cv_qualifiers
1819 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1822 using __type =
typename __match::__type;
1826 template<
typename _Tp>
1827 struct __make_unsigned
1828 {
using __type = _Tp; };
1831 struct __make_unsigned<char>
1832 {
using __type =
unsigned char; };
1835 struct __make_unsigned<signed char>
1836 {
using __type =
unsigned char; };
1839 struct __make_unsigned<short>
1840 {
using __type =
unsigned short; };
1843 struct __make_unsigned<int>
1844 {
using __type =
unsigned int; };
1847 struct __make_unsigned<long>
1848 {
using __type =
unsigned long; };
1851 struct __make_unsigned<long long>
1852 {
using __type =
unsigned long long; };
1854#if defined(__GLIBCXX_TYPE_INT_N_0)
1857 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1858 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1860#if defined(__GLIBCXX_TYPE_INT_N_1)
1863 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1864 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
1866#if defined(__GLIBCXX_TYPE_INT_N_2)
1869 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1870 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
1872#if defined(__GLIBCXX_TYPE_INT_N_3)
1875 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1876 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
1880 template<
typename _Tp,
1881 bool _IsInt = is_integral<_Tp>::value,
1882 bool _IsEnum = __is_enum(_Tp)>
1883 class __make_unsigned_selector;
1885 template<
typename _Tp>
1886 class __make_unsigned_selector<_Tp, true, false>
1888 using __unsigned_type
1889 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1893 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1896 class __make_unsigned_selector_base
1899 template<
typename...>
struct _List { };
1901 template<
typename _Tp,
typename... _Up>
1902 struct _List<_Tp, _Up...> : _List<_Up...>
1903 {
static constexpr size_t __size =
sizeof(_Tp); };
1905 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1908 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1909 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1910 {
using __type = _Uint; };
1912 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1913 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1914 : __select<_Sz, _List<_UInts...>>
1919 template<
typename _Tp>
1920 class __make_unsigned_selector<_Tp, false, true>
1921 : __make_unsigned_selector_base
1924 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1925 unsigned long,
unsigned long long>;
1927 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1931 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1939 struct __make_unsigned<wchar_t>
1942 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1945#ifdef _GLIBCXX_USE_CHAR8_T
1947 struct __make_unsigned<char8_t>
1950 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1955 struct __make_unsigned<char16_t>
1958 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1962 struct __make_unsigned<char32_t>
1965 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1973 template<
typename _Tp>
1975 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
1986 template<
typename _Tp>
1987 struct __make_signed
1988 {
using __type = _Tp; };
1991 struct __make_signed<char>
1992 {
using __type =
signed char; };
1995 struct __make_signed<unsigned char>
1996 {
using __type =
signed char; };
1999 struct __make_signed<unsigned short>
2000 {
using __type =
signed short; };
2003 struct __make_signed<unsigned int>
2004 {
using __type =
signed int; };
2007 struct __make_signed<unsigned long>
2008 {
using __type =
signed long; };
2011 struct __make_signed<unsigned long long>
2012 {
using __type =
signed long long; };
2014#if defined(__GLIBCXX_TYPE_INT_N_0)
2017 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
2018 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
2020#if defined(__GLIBCXX_TYPE_INT_N_1)
2023 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
2024 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
2026#if defined(__GLIBCXX_TYPE_INT_N_2)
2029 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
2030 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
2032#if defined(__GLIBCXX_TYPE_INT_N_3)
2035 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
2036 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
2040 template<
typename _Tp,
2041 bool _IsInt = is_integral<_Tp>::value,
2042 bool _IsEnum = __is_enum(_Tp)>
2043 class __make_signed_selector;
2045 template<
typename _Tp>
2046 class __make_signed_selector<_Tp, true, false>
2049 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2053 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2057 template<
typename _Tp>
2058 class __make_signed_selector<_Tp, false, true>
2060 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2063 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2071 struct __make_signed<wchar_t>
2074 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2077#if defined(_GLIBCXX_USE_CHAR8_T)
2079 struct __make_signed<char8_t>
2082 =
typename __make_signed_selector<char8_t, false, true>::__type;
2087 struct __make_signed<char16_t>
2090 =
typename __make_signed_selector<char16_t, false, true>::__type;
2094 struct __make_signed<char32_t>
2097 =
typename __make_signed_selector<char32_t, false, true>::__type;
2105 template<
typename _Tp>
2107 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2113 template<>
struct make_signed<bool const volatile>;
2115#if __cplusplus > 201103L
2117 template<
typename _Tp>
2121 template<
typename _Tp>
2128#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_extent)
2129 template<
typename _Tp>
2131 {
using type = __remove_extent(_Tp); };
2133 template<
typename _Tp>
2135 {
using type = _Tp; };
2137 template<
typename _Tp, std::
size_t _Size>
2139 {
using type = _Tp; };
2141 template<
typename _Tp>
2142 struct remove_extent<_Tp[]>
2143 {
using type = _Tp; };
2147#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_all_extents)
2148 template<
typename _Tp>
2149 struct remove_all_extents
2150 {
using type = __remove_all_extents(_Tp); };
2152 template<
typename _Tp>
2154 {
using type = _Tp; };
2156 template<
typename _Tp, std::
size_t _Size>
2158 {
using type =
typename remove_all_extents<_Tp>::type; };
2160 template<
typename _Tp>
2161 struct remove_all_extents<_Tp[]>
2162 {
using type =
typename remove_all_extents<_Tp>::type; };
2165#if __cplusplus > 201103L
2167 template<
typename _Tp>
2171 template<
typename _Tp>
2178#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2179 template<
typename _Tp>
2180 struct remove_pointer
2181 {
using type = __remove_pointer(_Tp); };
2183 template<
typename _Tp,
typename>
2185 {
using type = _Tp; };
2187 template<
typename _Tp,
typename _Up>
2189 {
using type = _Up; };
2191 template<
typename _Tp>
2192 struct remove_pointer
2193 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2198#if _GLIBCXX_USE_BUILTIN_TRAIT(__add_pointer)
2199 template<
typename _Tp>
2201 {
using type = __add_pointer(_Tp); };
2203 template<
typename _Tp,
typename =
void>
2205 {
using type = _Tp; };
2207 template<
typename _Tp>
2209 {
using type = _Tp*; };
2211 template<
typename _Tp>
2213 :
public __add_pointer_helper<_Tp>
2216 template<
typename _Tp>
2217 struct add_pointer<_Tp&>
2218 {
using type = _Tp*; };
2220 template<
typename _Tp>
2221 struct add_pointer<_Tp&&>
2222 {
using type = _Tp*; };
2225#if __cplusplus > 201103L
2227 template<
typename _Tp>
2231 template<
typename _Tp>
2235 template<std::
size_t _Len>
2236 struct __aligned_storage_msa
2240 unsigned char __data[_Len];
2241 struct __attribute__((__aligned__)) { } __align;
2258 template<std::size_t _Len, std::size_t _Align =
2259 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2261 _GLIBCXX23_DEPRECATED
2266 unsigned char __data[_Len];
2267 struct __attribute__((__aligned__((_Align)))) { } __align;
2271 template <
typename... _Types>
2272 struct __strictest_alignment
2274 static const size_t _S_alignment = 0;
2275 static const size_t _S_size = 0;
2278 template <
typename _Tp,
typename... _Types>
2279 struct __strictest_alignment<_Tp, _Types...>
2281 static const size_t _S_alignment =
2282 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2283 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2284 static const size_t _S_size =
2285 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2286 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2289#pragma GCC diagnostic push
2290#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2304 template <
size_t _Len,
typename... _Types>
2306 _GLIBCXX23_DEPRECATED
2310 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2312 using __strictest = __strictest_alignment<_Types...>;
2313 static const size_t _S_len = _Len > __strictest::_S_size
2314 ? _Len : __strictest::_S_size;
2317 static const size_t alignment_value = __strictest::_S_alignment;
2322 template <
size_t _Len,
typename... _Types>
2323 const size_t aligned_union<_Len, _Types...>::alignment_value;
2324#pragma GCC diagnostic pop
2328#if _GLIBCXX_USE_BUILTIN_TRAIT(__decay)
2329 template<
typename _Tp>
2331 {
using type = __decay(_Tp); };
2335 template<
typename _Up>
2336 struct __decay_selector
2337 : __conditional_t<is_const<const _Up>::value,
2342 template<
typename _Up,
size_t _Nm>
2343 struct __decay_selector<_Up[_Nm]>
2344 {
using type = _Up*; };
2346 template<
typename _Up>
2347 struct __decay_selector<_Up[]>
2348 {
using type = _Up*; };
2353 template<
typename _Tp>
2355 {
using type =
typename __decay_selector<_Tp>::type; };
2357 template<
typename _Tp>
2359 {
using type =
typename __decay_selector<_Tp>::type; };
2361 template<
typename _Tp>
2363 {
using type =
typename __decay_selector<_Tp>::type; };
2369 template<
typename _Tp>
2370 struct __strip_reference_wrapper
2375 template<
typename _Tp>
2376 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2378 using __type = _Tp&;
2382 template<
typename _Tp>
2383 using __decay_t =
typename decay<_Tp>::type;
2385 template<
typename _Tp>
2386 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2392 template<
typename... _Cond>
2393 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2396 template<
typename _Tp>
2397 using __remove_cvref_t
2398 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2403 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2405 {
using type = _Iftrue; };
2408 template<
typename _Iftrue,
typename _Iffalse>
2410 {
using type = _Iffalse; };
2413 template<
typename... _Tp>
2425 template<
typename _Tp>
2426 struct __success_type
2427 {
using type = _Tp; };
2429 struct __failure_type
2432 struct __do_common_type_impl
2434 template<
typename _Tp,
typename _Up>
2436 =
decltype(
true ? std::declval<_Tp>() :
std::declval<_Up>());
2440 template<
typename _Tp,
typename _Up>
2441 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2444#if __cplusplus > 201703L
2447 template<
typename _Tp,
typename _Up>
2448 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2452 template<
typename,
typename>
2453 static __failure_type
2456 template<
typename _Tp,
typename _Up>
2457 static decltype(_S_test_2<_Tp, _Up>(0))
2463 struct common_type<>
2467 template<
typename _Tp0>
2468 struct common_type<_Tp0>
2469 :
public common_type<_Tp0, _Tp0>
2473 template<
typename _Tp1,
typename _Tp2,
2474 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2475 struct __common_type_impl
2479 using type = common_type<_Dp1, _Dp2>;
2482 template<
typename _Tp1,
typename _Tp2>
2483 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2484 :
private __do_common_type_impl
2488 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2492 template<
typename _Tp1,
typename _Tp2>
2493 struct common_type<_Tp1, _Tp2>
2494 :
public __common_type_impl<_Tp1, _Tp2>::type
2497 template<
typename...>
2498 struct __common_type_pack
2501 template<
typename,
typename,
typename =
void>
2502 struct __common_type_fold;
2505 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2506 struct common_type<_Tp1, _Tp2, _Rp...>
2507 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2508 __common_type_pack<_Rp...>>
2514 template<
typename _CTp,
typename... _Rp>
2515 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2516 __void_t<typename _CTp::type>>
2517 :
public common_type<typename _CTp::type, _Rp...>
2521 template<
typename _CTp,
typename _Rp>
2522 struct __common_type_fold<_CTp, _Rp, void>
2525 template<
typename _Tp,
bool = __is_enum(_Tp)>
2526 struct __underlying_type_impl
2528 using type = __underlying_type(_Tp);
2531 template<
typename _Tp>
2532 struct __underlying_type_impl<_Tp, false>
2537 template<
typename _Tp>
2539 :
public __underlying_type_impl<_Tp>
2543 template<
typename _Tp>
2544 struct __declval_protector
2546 static const bool __stop =
false;
2554 template<
typename _Tp>
2555 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2557 static_assert(__declval_protector<_Tp>::__stop,
2558 "declval() must not be used!");
2559 return __declval<_Tp>(0);
2563 template<
typename _Signature>
2569 struct __invoke_memfun_ref { };
2570 struct __invoke_memfun_deref { };
2571 struct __invoke_memobj_ref { };
2572 struct __invoke_memobj_deref { };
2573 struct __invoke_other { };
2576 template<
typename _Tp,
typename _Tag>
2577 struct __result_of_success : __success_type<_Tp>
2578 {
using __invoke_type = _Tag; };
2581 struct __result_of_memfun_ref_impl
2583 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2584 static __result_of_success<
decltype(
2585 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2586 ), __invoke_memfun_ref> _S_test(
int);
2588 template<
typename...>
2589 static __failure_type _S_test(...);
2592 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2593 struct __result_of_memfun_ref
2594 :
private __result_of_memfun_ref_impl
2596 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2600 struct __result_of_memfun_deref_impl
2602 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2603 static __result_of_success<
decltype(
2604 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2605 ), __invoke_memfun_deref> _S_test(
int);
2607 template<
typename...>
2608 static __failure_type _S_test(...);
2611 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2612 struct __result_of_memfun_deref
2613 :
private __result_of_memfun_deref_impl
2615 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2619 struct __result_of_memobj_ref_impl
2621 template<
typename _Fp,
typename _Tp1>
2622 static __result_of_success<
decltype(
2623 std::declval<_Tp1>().*std::declval<_Fp>()
2624 ), __invoke_memobj_ref> _S_test(
int);
2626 template<
typename,
typename>
2627 static __failure_type _S_test(...);
2630 template<
typename _MemPtr,
typename _Arg>
2631 struct __result_of_memobj_ref
2632 :
private __result_of_memobj_ref_impl
2634 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2638 struct __result_of_memobj_deref_impl
2640 template<
typename _Fp,
typename _Tp1>
2641 static __result_of_success<
decltype(
2642 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2643 ), __invoke_memobj_deref> _S_test(
int);
2645 template<
typename,
typename>
2646 static __failure_type _S_test(...);
2649 template<
typename _MemPtr,
typename _Arg>
2650 struct __result_of_memobj_deref
2651 :
private __result_of_memobj_deref_impl
2653 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2656 template<
typename _MemPtr,
typename _Arg>
2657 struct __result_of_memobj;
2659 template<
typename _Res,
typename _Class,
typename _Arg>
2660 struct __result_of_memobj<_Res _Class::*, _Arg>
2662 using _Argval = __remove_cvref_t<_Arg>;
2663 using _MemPtr = _Res _Class::*;
2664 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2665 is_base_of<_Class, _Argval>>::value,
2666 __result_of_memobj_ref<_MemPtr, _Arg>,
2667 __result_of_memobj_deref<_MemPtr, _Arg>
2671 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2672 struct __result_of_memfun;
2674 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2675 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2677 using _Argval =
typename remove_reference<_Arg>::type;
2678 using _MemPtr = _Res _Class::*;
2679 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2680 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2681 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2690 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2696 template<
typename _Tp,
typename _Up>
2697 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2702 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2703 struct __result_of_impl
2705 using type = __failure_type;
2708 template<
typename _MemPtr,
typename _Arg>
2709 struct __result_of_impl<true, false, _MemPtr, _Arg>
2710 :
public __result_of_memobj<__decay_t<_MemPtr>,
2711 typename __inv_unwrap<_Arg>::type>
2714 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2715 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2716 :
public __result_of_memfun<__decay_t<_MemPtr>,
2717 typename __inv_unwrap<_Arg>::type, _Args...>
2721 struct __result_of_other_impl
2723 template<
typename _Fn,
typename... _Args>
2724 static __result_of_success<
decltype(
2725 std::declval<_Fn>()(std::declval<_Args>()...)
2726 ), __invoke_other> _S_test(
int);
2728 template<
typename...>
2729 static __failure_type _S_test(...);
2732 template<
typename _Functor,
typename... _ArgTypes>
2733 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2734 :
private __result_of_other_impl
2736 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2740 template<
typename _Functor,
typename... _ArgTypes>
2741 struct __invoke_result
2742 :
public __result_of_impl<
2743 is_member_object_pointer<
2744 typename remove_reference<_Functor>::type
2746 is_member_function_pointer<
2747 typename remove_reference<_Functor>::type
2749 _Functor, _ArgTypes...
2754 template<
typename _Fn,
typename... _Args>
2755 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2758 template<
typename _Functor,
typename... _ArgTypes>
2759 struct result_of<_Functor(_ArgTypes...)>
2760 :
public __invoke_result<_Functor, _ArgTypes...>
2761 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2763#if __cplusplus >= 201402L
2764#pragma GCC diagnostic push
2765#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2767 template<
size_t _Len,
size_t _Align =
2768 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2771 template <
size_t _Len,
typename... _Types>
2772 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2773#pragma GCC diagnostic pop
2776 template<
typename _Tp>
2780 template<
bool _Cond,
typename _Tp =
void>
2784 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2788 template<
typename... _Tp>
2792 template<
typename _Tp>
2796 template<
typename _Tp>
2800#ifdef __cpp_lib_void_t
2802 template<typename...> using void_t = void;
2812 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2813 struct __detected_or
2820 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2821 requires requires {
typename _Op<_Args...>; }
2822 struct __detected_or<_Def, _Op, _Args...>
2824 using type = _Op<_Args...>;
2829 template<
typename _Default,
typename _AlwaysVoid,
2830 template<
typename...>
class _Op,
typename... _Args>
2833 using type = _Default;
2838 template<
typename _Default,
template<
typename...>
class _Op,
2840 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2842 using type = _Op<_Args...>;
2846 template<
typename _Default,
template<
typename...>
class _Op,
2848 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2852 template<
typename _Default,
template<
typename...>
class _Op,
2854 using __detected_or_t
2855 =
typename __detected_or<_Default, _Op, _Args...>::type;
2861#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2862 template<typename _Tp, typename = __void_t<>> \
2863 struct __has_##_NTYPE \
2866 template<typename _Tp> \
2867 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2871 template <
typename _Tp>
2872 struct __is_swappable;
2874 template <
typename _Tp>
2875 struct __is_nothrow_swappable;
2882 template<
typename _Tp>
2883 struct __is_tuple_like
2884 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2888 template<
typename _Tp>
2889 _GLIBCXX20_CONSTEXPR
2891 _Require<__not_<__is_tuple_like<_Tp>>,
2892 is_move_constructible<_Tp>,
2893 is_move_assignable<_Tp>>
2895 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2896 is_nothrow_move_assignable<_Tp>>::value);
2898 template<
typename _Tp,
size_t _Nm>
2899 _GLIBCXX20_CONSTEXPR
2901 __enable_if_t<__is_swappable<_Tp>::value>
2902 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2903 noexcept(__is_nothrow_swappable<_Tp>::value);
2906 namespace __swappable_details {
2909 struct __do_is_swappable_impl
2911 template<
typename _Tp,
typename
2912 =
decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2913 static true_type __test(
int);
2919 struct __do_is_nothrow_swappable_impl
2921 template<
typename _Tp>
2922 static __bool_constant<
2923 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2932 template<
typename _Tp>
2933 struct __is_swappable_impl
2934 :
public __swappable_details::__do_is_swappable_impl
2936 using type =
decltype(__test<_Tp>(0));
2939 template<
typename _Tp>
2940 struct __is_nothrow_swappable_impl
2941 :
public __swappable_details::__do_is_nothrow_swappable_impl
2943 using type =
decltype(__test<_Tp>(0));
2946 template<
typename _Tp>
2947 struct __is_swappable
2948 :
public __is_swappable_impl<_Tp>::type
2951 template<
typename _Tp>
2952 struct __is_nothrow_swappable
2953 :
public __is_nothrow_swappable_impl<_Tp>::type
2957#ifdef __cpp_lib_is_swappable
2961 template<
typename _Tp>
2963 :
public __is_swappable_impl<_Tp>::type
2965 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2966 "template argument must be a complete class or an unbounded array");
2970 template<
typename _Tp>
2971 struct is_nothrow_swappable
2972 :
public __is_nothrow_swappable_impl<_Tp>::type
2974 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2975 "template argument must be a complete class or an unbounded array");
2978#if __cplusplus >= 201402L
2980 template<
typename _Tp>
2981 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
2982 is_swappable<_Tp>::value;
2985 template<
typename _Tp>
2986 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
2987 is_nothrow_swappable<_Tp>::value;
2991 namespace __swappable_with_details {
2994 struct __do_is_swappable_with_impl
2996 template<
typename _Tp,
typename _Up,
typename
2997 =
decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2999 =
decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
3002 template<
typename,
typename>
3006 struct __do_is_nothrow_swappable_with_impl
3008 template<
typename _Tp,
typename _Up>
3009 static __bool_constant<
3010 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
3012 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
3015 template<
typename,
typename>
3021 template<
typename _Tp,
typename _Up>
3022 struct __is_swappable_with_impl
3023 :
public __swappable_with_details::__do_is_swappable_with_impl
3025 using type =
decltype(__test<_Tp, _Up>(0));
3029 template<
typename _Tp>
3030 struct __is_swappable_with_impl<_Tp&, _Tp&>
3031 :
public __swappable_details::__do_is_swappable_impl
3033 using type =
decltype(__test<_Tp&>(0));
3036 template<
typename _Tp,
typename _Up>
3037 struct __is_nothrow_swappable_with_impl
3038 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
3040 using type =
decltype(__test<_Tp, _Up>(0));
3044 template<
typename _Tp>
3045 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
3046 :
public __swappable_details::__do_is_nothrow_swappable_impl
3048 using type =
decltype(__test<_Tp&>(0));
3053 template<
typename _Tp,
typename _Up>
3054 struct is_swappable_with
3055 :
public __is_swappable_with_impl<_Tp, _Up>::type
3057 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3058 "first template argument must be a complete class or an unbounded array");
3059 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3060 "second template argument must be a complete class or an unbounded array");
3064 template<
typename _Tp,
typename _Up>
3065 struct is_nothrow_swappable_with
3066 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
3068 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3069 "first template argument must be a complete class or an unbounded array");
3070 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3071 "second template argument must be a complete class or an unbounded array");
3074#if __cplusplus >= 201402L
3076 template<
typename _Tp,
typename _Up>
3077 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3078 is_swappable_with<_Tp, _Up>::value;
3081 template<
typename _Tp,
typename _Up>
3082 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3083 is_nothrow_swappable_with<_Tp, _Up>::value;
3093 template<
typename _Result,
typename _Ret,
3094 bool = is_void<_Ret>::value,
typename =
void>
3095 struct __is_invocable_impl
3102 template<
typename _Result,
typename _Ret>
3103 struct __is_invocable_impl<_Result, _Ret,
3105 __void_t<typename _Result::type>>
3111#pragma GCC diagnostic push
3112#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3114 template<
typename _Result,
typename _Ret>
3115 struct __is_invocable_impl<_Result, _Ret,
3117 __void_t<typename _Result::type>>
3121 using _Res_t =
typename _Result::type;
3125 static _Res_t _S_get() noexcept;
3128 template<typename _Tp>
3129 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3132 template<typename _Tp,
3133 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3134 typename = decltype(_S_conv<_Tp>(_S_get())),
3135#if __has_builtin(__reference_converts_from_temporary)
3136 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3138 bool _Dangle =
false
3141 static __bool_constant<_Nothrow && !_Dangle>
3144 template<
typename _Tp,
bool = false>
3150 using type =
decltype(_S_test<_Ret,
true>(1));
3153 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3155#pragma GCC diagnostic pop
3157 template<
typename _Fn,
typename... _ArgTypes>
3158 struct __is_invocable
3159 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3162 template<
typename _Fn,
typename _Tp,
typename... _Args>
3163 constexpr bool __call_is_nt(__invoke_memfun_ref)
3165 using _Up =
typename __inv_unwrap<_Tp>::type;
3166 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
3167 std::declval<_Args>()...));
3170 template<
typename _Fn,
typename _Tp,
typename... _Args>
3171 constexpr bool __call_is_nt(__invoke_memfun_deref)
3173 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
3174 std::declval<_Args>()...));
3177 template<
typename _Fn,
typename _Tp>
3178 constexpr bool __call_is_nt(__invoke_memobj_ref)
3180 using _Up =
typename __inv_unwrap<_Tp>::type;
3181 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
3184 template<
typename _Fn,
typename _Tp>
3185 constexpr bool __call_is_nt(__invoke_memobj_deref)
3187 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
3190 template<
typename _Fn,
typename... _Args>
3191 constexpr bool __call_is_nt(__invoke_other)
3193 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
3196 template<
typename _Result,
typename _Fn,
typename... _Args>
3197 struct __call_is_nothrow
3199 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3203 template<
typename _Fn,
typename... _Args>
3204 using __call_is_nothrow_
3205 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3208 template<
typename _Fn,
typename... _Args>
3209 struct __is_nothrow_invocable
3210 : __and_<__is_invocable<_Fn, _Args...>,
3211 __call_is_nothrow_<_Fn, _Args...>>::type
3214#pragma GCC diagnostic push
3215#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3216 struct __nonesuchbase {};
3217 struct __nonesuch :
private __nonesuchbase {
3218 ~__nonesuch() =
delete;
3219 __nonesuch(__nonesuch
const&) =
delete;
3220 void operator=(__nonesuch
const&) =
delete;
3222#pragma GCC diagnostic pop
3225#ifdef __cpp_lib_is_invocable
3227 template<typename _Functor, typename... _ArgTypes>
3228 struct invoke_result
3229 :
public __invoke_result<_Functor, _ArgTypes...>
3231 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3232 "_Functor must be a complete class or an unbounded array");
3233 static_assert((std::__is_complete_or_unbounded(
3234 __type_identity<_ArgTypes>{}) && ...),
3235 "each argument type must be a complete class or an unbounded array");
3239 template<
typename _Fn,
typename... _Args>
3240 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3243 template<
typename _Fn,
typename... _ArgTypes>
3245#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_invocable)
3246 :
public __bool_constant<__is_invocable(_Fn, _ArgTypes...)>
3248 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3251 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3252 "_Fn must be a complete class or an unbounded array");
3253 static_assert((std::__is_complete_or_unbounded(
3254 __type_identity<_ArgTypes>{}) && ...),
3255 "each argument type must be a complete class or an unbounded array");
3259 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3260 struct is_invocable_r
3261 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3263 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3264 "_Fn must be a complete class or an unbounded array");
3265 static_assert((std::__is_complete_or_unbounded(
3266 __type_identity<_ArgTypes>{}) && ...),
3267 "each argument type must be a complete class or an unbounded array");
3268 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3269 "_Ret must be a complete class or an unbounded array");
3273 template<
typename _Fn,
typename... _ArgTypes>
3274 struct is_nothrow_invocable
3275#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_invocable)
3276 :
public __bool_constant<__is_nothrow_invocable(_Fn, _ArgTypes...)>
3278 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3279 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3282 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3283 "_Fn must be a complete class or an unbounded array");
3284 static_assert((std::__is_complete_or_unbounded(
3285 __type_identity<_ArgTypes>{}) && ...),
3286 "each argument type must be a complete class or an unbounded array");
3293 template<
typename _Result,
typename _Ret>
3294 using __is_nt_invocable_impl
3295 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3299 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3300 struct is_nothrow_invocable_r
3301 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3302 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3304 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3305 "_Fn must be a complete class or an unbounded array");
3306 static_assert((std::__is_complete_or_unbounded(
3307 __type_identity<_ArgTypes>{}) && ...),
3308 "each argument type must be a complete class or an unbounded array");
3309 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3310 "_Ret must be a complete class or an unbounded array");
3314#if __cpp_lib_type_trait_variable_templates
3329template <
typename _Tp>
3330 inline constexpr bool is_void_v = is_void<_Tp>::value;
3331template <
typename _Tp>
3332 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3333template <
typename _Tp>
3334 inline constexpr bool is_integral_v = is_integral<_Tp>::value;
3335template <
typename _Tp>
3336 inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
3338#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3339template <
typename _Tp>
3340 inline constexpr bool is_array_v = __is_array(_Tp);
3342template <
typename _Tp>
3343 inline constexpr bool is_array_v =
false;
3344template <
typename _Tp>
3345 inline constexpr bool is_array_v<_Tp[]> =
true;
3346template <
typename _Tp,
size_t _Num>
3347 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3350#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_pointer)
3351template <
typename _Tp>
3352 inline constexpr bool is_pointer_v = __is_pointer(_Tp);
3354template <
typename _Tp>
3355 inline constexpr bool is_pointer_v =
false;
3356template <
typename _Tp>
3357 inline constexpr bool is_pointer_v<_Tp*> =
true;
3358template <
typename _Tp>
3359 inline constexpr bool is_pointer_v<_Tp* const> =
true;
3360template <
typename _Tp>
3361 inline constexpr bool is_pointer_v<_Tp* volatile> =
true;
3362template <
typename _Tp>
3363 inline constexpr bool is_pointer_v<_Tp* const volatile> =
true;
3366template <
typename _Tp>
3367 inline constexpr bool is_lvalue_reference_v =
false;
3368template <
typename _Tp>
3369 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3370template <
typename _Tp>
3371 inline constexpr bool is_rvalue_reference_v =
false;
3372template <
typename _Tp>
3373 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3375#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3376template <
typename _Tp>
3377 inline constexpr bool is_member_object_pointer_v =
3378 __is_member_object_pointer(_Tp);
3380template <
typename _Tp>
3381 inline constexpr bool is_member_object_pointer_v =
3382 is_member_object_pointer<_Tp>::value;
3385#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3386template <
typename _Tp>
3387 inline constexpr bool is_member_function_pointer_v =
3388 __is_member_function_pointer(_Tp);
3390template <
typename _Tp>
3391 inline constexpr bool is_member_function_pointer_v =
3392 is_member_function_pointer<_Tp>::value;
3395template <
typename _Tp>
3396 inline constexpr bool is_enum_v = __is_enum(_Tp);
3397template <
typename _Tp>
3398 inline constexpr bool is_union_v = __is_union(_Tp);
3399template <
typename _Tp>
3400 inline constexpr bool is_class_v = __is_class(_Tp);
3403#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3404template <
typename _Tp>
3405 inline constexpr bool is_reference_v = __is_reference(_Tp);
3407template <
typename _Tp>
3408 inline constexpr bool is_reference_v =
false;
3409template <
typename _Tp>
3410 inline constexpr bool is_reference_v<_Tp&> =
true;
3411template <
typename _Tp>
3412 inline constexpr bool is_reference_v<_Tp&&> =
true;
3415template <
typename _Tp>
3416 inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3417template <
typename _Tp>
3418 inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
3420#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3421template <
typename _Tp>
3422 inline constexpr bool is_object_v = __is_object(_Tp);
3424template <
typename _Tp>
3425 inline constexpr bool is_object_v = is_object<_Tp>::value;
3428template <
typename _Tp>
3429 inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
3430template <
typename _Tp>
3431 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3433#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3434template <
typename _Tp>
3435 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3437template <
typename _Tp>
3438 inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
3441#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_const)
3442template <
typename _Tp>
3443 inline constexpr bool is_const_v = __is_const(_Tp);
3445template <
typename _Tp>
3446 inline constexpr bool is_const_v =
false;
3447template <
typename _Tp>
3448 inline constexpr bool is_const_v<const _Tp> =
true;
3451#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3452template <
typename _Tp>
3453 inline constexpr bool is_function_v = __is_function(_Tp);
3455template <
typename _Tp>
3456 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3457template <
typename _Tp>
3458 inline constexpr bool is_function_v<_Tp&> =
false;
3459template <
typename _Tp>
3460 inline constexpr bool is_function_v<_Tp&&> =
false;
3463#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_volatile)
3464template <
typename _Tp>
3465 inline constexpr bool is_volatile_v = __is_volatile(_Tp);
3467template <
typename _Tp>
3468 inline constexpr bool is_volatile_v =
false;
3469template <
typename _Tp>
3470 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3473template <
typename _Tp>
3474 inline constexpr bool is_trivial_v = __is_trivial(_Tp);
3475template <
typename _Tp>
3476 inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3477template <
typename _Tp>
3478 inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
3479template <
typename _Tp>
3480 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3481 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3482template <typename _Tp>
3483 _GLIBCXX17_DEPRECATED
3484 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3485template <typename _Tp>
3486 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3487template <typename _Tp>
3488 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3489template <typename _Tp>
3490 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3491template <typename _Tp>
3492 inline constexpr
bool is_final_v = __is_final(_Tp);
3494template <typename _Tp>
3495 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
3496template <typename _Tp>
3497 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
3499template <typename _Tp, typename... _Args>
3500 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3501template <typename _Tp>
3502 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3503template <typename _Tp>
3504 inline constexpr
bool is_copy_constructible_v
3505 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3506template <typename _Tp>
3507 inline constexpr
bool is_move_constructible_v
3508 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3510template <typename _Tp, typename _Up>
3511 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3512template <typename _Tp>
3513 inline constexpr
bool is_copy_assignable_v
3514 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3515template <typename _Tp>
3516 inline constexpr
bool is_move_assignable_v
3517 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3519template <typename _Tp>
3520 inline constexpr
bool is_destructible_v = is_destructible<_Tp>::value;
3522template <typename _Tp, typename... _Args>
3523 inline constexpr
bool is_trivially_constructible_v
3524 = __is_trivially_constructible(_Tp, _Args...);
3525template <typename _Tp>
3526 inline constexpr
bool is_trivially_default_constructible_v
3527 = __is_trivially_constructible(_Tp);
3528template <typename _Tp>
3529 inline constexpr
bool is_trivially_copy_constructible_v
3530 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3531template <typename _Tp>
3532 inline constexpr
bool is_trivially_move_constructible_v
3533 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3535template <typename _Tp, typename _Up>
3536 inline constexpr
bool is_trivially_assignable_v
3537 = __is_trivially_assignable(_Tp, _Up);
3538template <typename _Tp>
3539 inline constexpr
bool is_trivially_copy_assignable_v
3540 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3541 __add_lval_ref_t<const _Tp>);
3542template <typename _Tp>
3543 inline constexpr
bool is_trivially_move_assignable_v
3544 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3545 __add_rval_ref_t<_Tp>);
3548template <
typename _Tp>
3549 inline constexpr bool is_trivially_destructible_v =
false;
3551template <
typename _Tp>
3552 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3553 inline constexpr bool is_trivially_destructible_v<_Tp>
3554 = __has_trivial_destructor(_Tp);
3555template <
typename _Tp>
3556 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3557template <
typename _Tp>
3558 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3559template <
typename _Tp,
size_t _Nm>
3560 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3561 = is_trivially_destructible_v<_Tp>;
3563template <
typename _Tp>
3564 inline constexpr bool is_trivially_destructible_v =
3565 is_trivially_destructible<_Tp>::value;
3568template <
typename _Tp,
typename... _Args>
3569 inline constexpr bool is_nothrow_constructible_v
3570 = __is_nothrow_constructible(_Tp, _Args...);
3571template <
typename _Tp>
3572 inline constexpr bool is_nothrow_default_constructible_v
3573 = __is_nothrow_constructible(_Tp);
3574template <
typename _Tp>
3575 inline constexpr bool is_nothrow_copy_constructible_v
3576 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3577template <
typename _Tp>
3578 inline constexpr bool is_nothrow_move_constructible_v
3579 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3581template <
typename _Tp,
typename _Up>
3582 inline constexpr bool is_nothrow_assignable_v
3583 = __is_nothrow_assignable(_Tp, _Up);
3584template <
typename _Tp>
3585 inline constexpr bool is_nothrow_copy_assignable_v
3586 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3587 __add_lval_ref_t<const _Tp>);
3588template <
typename _Tp>
3589 inline constexpr bool is_nothrow_move_assignable_v
3590 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3592template <
typename _Tp>
3593 inline constexpr bool is_nothrow_destructible_v =
3594 is_nothrow_destructible<_Tp>::value;
3596template <
typename _Tp>
3597 inline constexpr bool has_virtual_destructor_v
3598 = __has_virtual_destructor(_Tp);
3600template <
typename _Tp>
3601 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3603#if _GLIBCXX_USE_BUILTIN_TRAIT(__array_rank)
3604template <
typename _Tp>
3605 inline constexpr size_t rank_v = __array_rank(_Tp);
3607template <
typename _Tp>
3608 inline constexpr size_t rank_v = 0;
3609template <
typename _Tp,
size_t _Size>
3610 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3611template <
typename _Tp>
3612 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3615template <
typename _Tp,
unsigned _Idx = 0>
3616 inline constexpr size_t extent_v = 0;
3617template <
typename _Tp,
size_t _Size>
3618 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3619template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3620 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3621template <
typename _Tp>
3622 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3623template <
typename _Tp,
unsigned _Idx>
3624 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3626#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3627template <
typename _Tp,
typename _Up>
3628 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3630template <
typename _Tp,
typename _Up>
3631 inline constexpr bool is_same_v =
false;
3632template <
typename _Tp>
3633 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3635template <
typename _Base,
typename _Derived>
3636 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3637#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3638template <
typename _From,
typename _To>
3639 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3641template <
typename _From,
typename _To>
3642 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3644template<
typename _Fn,
typename... _Args>
3645 inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
3646template<
typename _Fn,
typename... _Args>
3647 inline constexpr bool is_nothrow_invocable_v
3648 = is_nothrow_invocable<_Fn, _Args...>::value;
3649template<
typename _Ret,
typename _Fn,
typename... _Args>
3650 inline constexpr bool is_invocable_r_v
3651 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3652template<
typename _Ret,
typename _Fn,
typename... _Args>
3653 inline constexpr bool is_nothrow_invocable_r_v
3654 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3658#ifdef __cpp_lib_has_unique_object_representations
3661 template<typename _Tp>
3662 struct has_unique_object_representations
3663 : bool_constant<__has_unique_object_representations(
3664 remove_cv_t<remove_all_extents_t<_Tp>>
3667 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3668 "template argument must be a complete class or an unbounded array");
3671# if __cpp_lib_type_trait_variable_templates
3673 template<typename _Tp>
3674 inline constexpr bool has_unique_object_representations_v
3675 = has_unique_object_representations<_Tp>::value;
3679#ifdef __cpp_lib_is_aggregate
3682 template<typename _Tp>
3684 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3687# if __cpp_lib_type_trait_variable_templates
3692 template<
typename _Tp>
3693 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3701#ifdef __cpp_lib_remove_cvref
3702# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3703 template<
typename _Tp>
3705 {
using type = __remove_cvref(_Tp); };
3707 template<
typename _Tp>
3709 {
using type =
typename remove_cv<_Tp>::type; };
3711 template<
typename _Tp>
3712 struct remove_cvref<_Tp&>
3713 {
using type =
typename remove_cv<_Tp>::type; };
3715 template<
typename _Tp>
3716 struct remove_cvref<_Tp&&>
3717 {
using type =
typename remove_cv<_Tp>::type; };
3720 template<
typename _Tp>
3721 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3725#ifdef __cpp_lib_type_identity
3730 template<
typename _Tp>
3731 struct type_identity {
using type = _Tp; };
3733 template<
typename _Tp>
3734 using type_identity_t =
typename type_identity<_Tp>::type;
3738#ifdef __cpp_lib_unwrap_ref
3743 template<
typename _Tp>
3744 struct unwrap_reference {
using type = _Tp; };
3746 template<
typename _Tp>
3747 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3749 template<
typename _Tp>
3750 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3757 template<
typename _Tp>
3758 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3760 template<
typename _Tp>
3761 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3765#ifdef __cpp_lib_bounded_array_traits
3769# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
3770 template<
typename _Tp>
3771 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
3773 template<
typename _Tp>
3774 inline constexpr bool is_bounded_array_v =
false;
3776 template<
typename _Tp,
size_t _Size>
3777 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
3783# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_unbounded_array)
3784 template<
typename _Tp>
3785 inline constexpr bool is_unbounded_array_v = __is_unbounded_array(_Tp);
3787 template<
typename _Tp>
3788 inline constexpr bool is_unbounded_array_v =
false;
3790 template<
typename _Tp>
3791 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
3796 template<
typename _Tp>
3797 struct is_bounded_array
3798 :
public bool_constant<is_bounded_array_v<_Tp>>
3803 template<
typename _Tp>
3804 struct is_unbounded_array
3805 :
public bool_constant<is_unbounded_array_v<_Tp>>
3809#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
3812 template<
typename _Tp,
typename _Up>
3814 : bool_constant<__is_layout_compatible(_Tp, _Up)>
3819 template<
typename _Tp,
typename _Up>
3821 = __is_layout_compatible(_Tp, _Up);
3823#if __has_builtin(__builtin_is_corresponding_member)
3824# ifndef __cpp_lib_is_layout_compatible
3825# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
3829 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
3832 {
return __builtin_is_corresponding_member(__m1, __m2); }
3836#if __has_builtin(__is_pointer_interconvertible_base_of) \
3837 && __cplusplus >= 202002L
3840 template<
typename _Base,
typename _Derived>
3842 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
3847 template<
typename _Base,
typename _Derived>
3849 = __is_pointer_interconvertible_base_of(_Base, _Derived);
3851#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
3852# ifndef __cpp_lib_is_pointer_interconvertible
3853# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
3859 template<
typename _Tp,
typename _Mem>
3862 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
3866#ifdef __cpp_lib_is_scoped_enum
3870# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3871 template<
typename _Tp>
3872 struct is_scoped_enum
3873 : bool_constant<__is_scoped_enum(_Tp)>
3876 template<
typename _Tp>
3877 struct is_scoped_enum
3881 template<
typename _Tp>
3882 requires __is_enum(_Tp)
3883 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
3884 struct is_scoped_enum<_Tp>
3885 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3891# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3892 template<
typename _Tp>
3893 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
3895 template<
typename _Tp>
3896 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3900#ifdef __cpp_lib_reference_from_temporary
3905 template<typename _Tp, typename _Up>
3906 struct reference_constructs_from_temporary
3907 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
3909 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3910 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3911 "template argument must be a complete class or an unbounded array");
3918 template<
typename _Tp,
typename _Up>
3919 struct reference_converts_from_temporary
3920 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
3922 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3923 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3924 "template argument must be a complete class or an unbounded array");
3929 template<
typename _Tp,
typename _Up>
3930 inline constexpr bool reference_constructs_from_temporary_v
3931 = reference_constructs_from_temporary<_Tp, _Up>::value;
3935 template<
typename _Tp,
typename _Up>
3936 inline constexpr bool reference_converts_from_temporary_v
3937 = reference_converts_from_temporary<_Tp, _Up>::value;
3940#ifdef __cpp_lib_is_constant_evaluated
3943 constexpr inline bool
3944 is_constant_evaluated() noexcept
3946#if __cpp_if_consteval >= 202106L
3947 if consteval {
return true; }
else {
return false; }
3949 return __builtin_is_constant_evaluated();
3954#if __cplusplus >= 202002L
3956 template<
typename _From,
typename _To>
3957 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3959 template<
typename _Xp,
typename _Yp>
3961 =
decltype(
false ? declval<_Xp(&)()>()() :
declval<_Yp(&)()>()());
3963 template<
typename _Ap,
typename _Bp,
typename =
void>
3964 struct __common_ref_impl
3968 template<
typename _Ap,
typename _Bp>
3969 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3972 template<
typename _Xp,
typename _Yp>
3973 using __condres_cvref
3974 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
3977 template<
typename _Xp,
typename _Yp>
3978 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
3979 : enable_if<is_reference_v<__condres_cvref<_Xp, _Yp>>,
3980 __condres_cvref<_Xp, _Yp>>
3984 template<
typename _Xp,
typename _Yp>
3985 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3988 template<
typename _Xp,
typename _Yp>
3989 struct __common_ref_impl<_Xp&&, _Yp&&,
3990 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3991 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3992 {
using type = __common_ref_C<_Xp, _Yp>; };
3995 template<
typename _Xp,
typename _Yp>
3996 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3999 template<
typename _Xp,
typename _Yp>
4000 struct __common_ref_impl<_Xp&&, _Yp&,
4001 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
4002 {
using type = __common_ref_D<_Xp, _Yp>; };
4005 template<
typename _Xp,
typename _Yp>
4006 struct __common_ref_impl<_Xp&, _Yp&&>
4007 : __common_ref_impl<_Yp&&, _Xp&>
4011 template<
typename _Tp,
typename _Up,
4012 template<
typename>
class _TQual,
template<
typename>
class _UQual>
4013 struct basic_common_reference
4017 template<
typename _Tp>
4019 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
4021 template<
typename _Tp>
4023 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
4025 template<
typename _Tp>
4026 struct __xref<_Tp&&>
4027 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
4029 template<
typename _Tp1,
typename _Tp2>
4030 using __basic_common_ref
4031 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
4032 remove_cvref_t<_Tp2>,
4033 __xref<_Tp1>::template __type,
4034 __xref<_Tp2>::template __type>::type;
4037 template<
typename... _Tp>
4038 struct common_reference;
4040 template<
typename... _Tp>
4045 struct common_reference<>
4049 template<
typename _Tp0>
4050 struct common_reference<_Tp0>
4051 {
using type = _Tp0; };
4054 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
4055 struct __common_reference_impl
4056 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
4060 template<
typename _Tp1,
typename _Tp2>
4061 struct common_reference<_Tp1, _Tp2>
4062 : __common_reference_impl<_Tp1, _Tp2>
4066 template<
typename _Tp1,
typename _Tp2>
4067 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
4068 void_t<__common_ref<_Tp1&, _Tp2&>>>
4069 {
using type = __common_ref<_Tp1&, _Tp2&>; };
4071 template<
typename _Tp1,
typename _Tp2>
4072 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
4073 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
4074 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
4076 template<
typename _Tp1,
typename _Tp2>
4077 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
4078 void_t<__common_ref<_Tp1&, _Tp2&&>>>
4079 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
4081 template<
typename _Tp1,
typename _Tp2>
4082 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
4083 void_t<__common_ref<_Tp1&&, _Tp2&>>>
4084 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
4087 template<
typename _Tp1,
typename _Tp2>
4088 struct __common_reference_impl<_Tp1, _Tp2, 2,
4089 void_t<__basic_common_ref<_Tp1, _Tp2>>>
4090 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
4093 template<
typename _Tp1,
typename _Tp2>
4094 struct __common_reference_impl<_Tp1, _Tp2, 3,
4095 void_t<__cond_res<_Tp1, _Tp2>>>
4096 {
using type = __cond_res<_Tp1, _Tp2>; };
4099 template<
typename _Tp1,
typename _Tp2>
4100 struct __common_reference_impl<_Tp1, _Tp2, 4,
4102 {
using type = common_type_t<_Tp1, _Tp2>; };
4105 template<
typename _Tp1,
typename _Tp2>
4106 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
4110 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4111 struct common_reference<_Tp1, _Tp2, _Rest...>
4112 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4113 __common_type_pack<_Rest...>>
4117 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4118 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4119 __common_type_pack<_Rest...>,
4121 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4129_GLIBCXX_END_NAMESPACE_VERSION
typename common_reference< _Tp... >::type common_reference_t
constexpr bool is_corresponding_member(_M1 _S1::*__m1, _M2 _S2::*__m2) noexcept
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
typename aligned_storage< _S_len, alignment_value >::type type
The storage.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
typename decay< _Tp >::type decay_t
Alias template for decay.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
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.
constexpr bool is_layout_compatible_v
constexpr bool is_pointer_interconvertible_base_of_v
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.
GNU extensions for public use.
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