29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
40namespace std _GLIBCXX_VISIBILITY(default)
42_GLIBCXX_BEGIN_NAMESPACE_VERSION
44 template<
typename _Tp>
45 class reference_wrapper;
61 template<
typename _Tp, _Tp __v>
64 static constexpr _Tp value = __v;
65 typedef _Tp value_type;
67 constexpr operator value_type()
const noexcept {
return value; }
68#if __cplusplus > 201103L
70#define __cpp_lib_integral_constant_callable 201304L
72 constexpr value_type operator()()
const noexcept {
return value; }
76#if ! __cpp_inline_variables
77 template<
typename _Tp, _Tp __v>
93#if __cplusplus >= 201703L
94# define __cpp_lib_bool_constant 201505L
105 template<
bool,
typename _Tp =
void>
110 template<
typename _Tp>
112 {
typedef _Tp type; };
115 template<
bool _Cond,
typename _Tp =
void>
116 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
121 template<
typename _Tp,
typename>
126 struct __conditional<false>
128 template<
typename,
typename _Up>
133 template<
bool _Cond,
typename _If,
typename _Else>
134 using __conditional_t
135 =
typename __conditional<_Cond>::template type<_If, _Else>;
138 template <
typename _Type>
139 struct __type_identity
140 {
using type = _Type; };
142 template<
typename _Tp>
143 using __type_identity_t =
typename __type_identity<_Tp>::type;
148 template<
typename _Tp,
typename...>
149 using __first_t = _Tp;
152 template<
typename... _Bn>
154 __enable_if_t<!bool(_Bn::value)>...>;
156 template<
typename... _Bn>
159 template<
typename... _Bn>
160 auto __and_fn(
int) -> __first_t<
true_type,
161 __enable_if_t<bool(_Bn::value)>...>;
163 template<
typename... _Bn>
170 template<
typename... _Bn>
172 : decltype(__detail::__or_fn<_Bn...>(0))
175 template<
typename... _Bn>
177 : decltype(__detail::__and_fn<_Bn...>(0))
180 template<
typename _Pp>
182 : __bool_constant<!bool(_Pp::value)>
186#if __cplusplus >= 201703L
189 template<
typename... _Bn>
190 inline constexpr bool __or_v = __or_<_Bn...>::value;
191 template<
typename... _Bn>
192 inline constexpr bool __and_v = __and_<_Bn...>::value;
196 template<
typename ,
typename _B1,
typename... _Bn>
197 struct __disjunction_impl
198 {
using type = _B1; };
200 template<
typename _B1,
typename _B2,
typename... _Bn>
201 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
202 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
204 template<
typename ,
typename _B1,
typename... _Bn>
205 struct __conjunction_impl
206 {
using type = _B1; };
208 template<
typename _B1,
typename _B2,
typename... _Bn>
209 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
210 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
214#define __cpp_lib_logical_traits 201510L
216 template<
typename... _Bn>
218 : __detail::__conjunction_impl<void, _Bn...>::type
226 template<
typename... _Bn>
228 : __detail::__disjunction_impl<void, _Bn...>::type
236 template<
typename _Pp>
244 template<
typename... _Bn>
245 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
247 template<
typename... _Bn>
248 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
250 template<
typename _Pp>
251 inline constexpr bool negation_v = negation<_Pp>::value;
270 struct __is_array_unknown_bounds;
275 template <
typename _Tp,
size_t = sizeof(_Tp)>
276 constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
279 template <
typename _TypeIdentity,
280 typename _NestedType =
typename _TypeIdentity::type>
281 constexpr typename __or_<
282 is_reference<_NestedType>,
283 is_function<_NestedType>,
284 is_void<_NestedType>,
285 __is_array_unknown_bounds<_NestedType>
286 >::type __is_complete_or_unbounded(_TypeIdentity)
290 template<
typename _Tp>
291 using __remove_cv_t =
typename remove_cv<_Tp>::type;
297 template<
typename _Tp>
306 struct is_void<const void>
310 struct is_void<volatile void>
314 struct is_void<const volatile void>
319 struct __is_integral_helper
323 struct __is_integral_helper<bool>
327 struct __is_integral_helper<char>
331 struct __is_integral_helper<signed char>
335 struct __is_integral_helper<unsigned char>
342 struct __is_integral_helper<wchar_t>
345#ifdef _GLIBCXX_USE_CHAR8_T
347 struct __is_integral_helper<char8_t>
352 struct __is_integral_helper<char16_t>
356 struct __is_integral_helper<char32_t>
360 struct __is_integral_helper<short>
364 struct __is_integral_helper<unsigned short>
368 struct __is_integral_helper<int>
372 struct __is_integral_helper<unsigned int>
376 struct __is_integral_helper<long>
380 struct __is_integral_helper<unsigned long>
384 struct __is_integral_helper<long long>
388 struct __is_integral_helper<unsigned long long>
393#if defined(__GLIBCXX_TYPE_INT_N_0)
396 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
401 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
404#if defined(__GLIBCXX_TYPE_INT_N_1)
407 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
412 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
415#if defined(__GLIBCXX_TYPE_INT_N_2)
418 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
423 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
426#if defined(__GLIBCXX_TYPE_INT_N_3)
429 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
434 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
440 template<
typename _Tp>
442 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
447 struct __is_floating_point_helper
451 struct __is_floating_point_helper<float>
455 struct __is_floating_point_helper<double>
459 struct __is_floating_point_helper<long double>
462#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
464 struct __is_floating_point_helper<__float128>
470 template<
typename _Tp>
472 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
480 template<
typename _Tp, std::
size_t _Size>
484 template<
typename _Tp>
485 struct is_array<_Tp[]>
489 struct __is_pointer_helper
492 template<
typename _Tp>
493 struct __is_pointer_helper<_Tp*>
497 template<
typename _Tp>
499 :
public __is_pointer_helper<__remove_cv_t<_Tp>>::type
507 template<
typename _Tp>
516 template<
typename _Tp>
521 struct __is_member_object_pointer_helper
524 template<
typename _Tp,
typename _Cp>
525 struct __is_member_object_pointer_helper<_Tp _Cp::*>
526 :
public __not_<is_function<_Tp>>::type { };
529 template<
typename _Tp>
531 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
535 struct __is_member_function_pointer_helper
538 template<
typename _Tp,
typename _Cp>
539 struct __is_member_function_pointer_helper<_Tp _Cp::*>
540 :
public is_function<_Tp>::type { };
543 template<
typename _Tp>
545 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
549 template<
typename _Tp>
555 template<
typename _Tp>
561 template<
typename _Tp>
567 template<
typename _Tp>
569 :
public __bool_constant<!is_const<const _Tp>::value> { };
571 template<
typename _Tp>
575 template<
typename _Tp>
576 struct is_function<_Tp&&>
579#define __cpp_lib_is_null_pointer 201309L
582 template<
typename _Tp>
591 struct is_null_pointer<const
std::nullptr_t>
595 struct is_null_pointer<volatile
std::nullptr_t>
599 struct is_null_pointer<const volatile
std::nullptr_t>
604 template<
typename _Tp>
607 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
612 template<
typename _Tp>
617 template<
typename _Tp>
622 template<
typename _Tp>
623 struct is_reference<_Tp&&>
628 template<
typename _Tp>
630 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
634 template<
typename _Tp>
636 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
637 is_null_pointer<_Tp>>::type
641 template<
typename _Tp>
643 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
651 template<
typename _Tp>
653 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
654 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
658 template<
typename _Tp>
660 :
public __not_<is_fundamental<_Tp>>::type { };
663 template<
typename _Tp>
664 struct __is_member_pointer_helper
667 template<
typename _Tp,
typename _Cp>
668 struct __is_member_pointer_helper<_Tp _Cp::*>
673 template<
typename _Tp>
675 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
678 template<
typename,
typename>
682 template<
typename _Tp,
typename... _Types>
683 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
687 template<
typename _Tp>
688 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
689 signed char,
signed short,
signed int,
signed long,
691#if defined(__GLIBCXX_TYPE_INT_N_0)
692 ,
signed __GLIBCXX_TYPE_INT_N_0
694#if defined(__GLIBCXX_TYPE_INT_N_1)
695 ,
signed __GLIBCXX_TYPE_INT_N_1
697#if defined(__GLIBCXX_TYPE_INT_N_2)
698 ,
signed __GLIBCXX_TYPE_INT_N_2
700#if defined(__GLIBCXX_TYPE_INT_N_3)
701 ,
signed __GLIBCXX_TYPE_INT_N_3
707 template<
typename _Tp>
708 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
709 unsigned char,
unsigned short,
unsigned int,
unsigned long,
711#if defined(__GLIBCXX_TYPE_INT_N_0)
712 ,
unsigned __GLIBCXX_TYPE_INT_N_0
714#if defined(__GLIBCXX_TYPE_INT_N_1)
715 ,
unsigned __GLIBCXX_TYPE_INT_N_1
717#if defined(__GLIBCXX_TYPE_INT_N_2)
718 ,
unsigned __GLIBCXX_TYPE_INT_N_2
720#if defined(__GLIBCXX_TYPE_INT_N_3)
721 ,
unsigned __GLIBCXX_TYPE_INT_N_3
726 template<
typename _Tp>
727 using __is_standard_integer
728 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
731 template<
typename...>
using __void_t = void;
741 template<
typename _Tp>
750 template<
typename _Tp>
755 template<
typename _Tp>
759 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
760 "template argument must be a complete class or an unbounded array");
764 template<
typename _Tp>
768 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
769 "template argument must be a complete class or an unbounded array");
773 template<
typename _Tp>
777 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
778 "template argument must be a complete class or an unbounded array");
786 template<
typename _Tp>
788 _GLIBCXX20_DEPRECATED(
"use is_standard_layout && is_trivial instead")
792 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
793 "template argument must be a complete class or an unbounded array");
800 template<
typename _Tp>
802 _GLIBCXX17_DEPRECATED
806 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
807 "template argument must be a complete class or an unbounded array");
811 template<
typename _Tp>
817 template<
typename _Tp>
822#if __cplusplus >= 201402L
823#define __cpp_lib_is_final 201402L
826 template<
typename _Tp>
833 template<
typename _Tp>
839 template<
typename _Tp,
841 struct __is_signed_helper
844 template<
typename _Tp>
845 struct __is_signed_helper<_Tp, true>
846 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
851 template<typename _Tp>
853 : public __is_signed_helper<_Tp>::type
857 template<typename _Tp>
859 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
863 template<typename _Tp, typename _Up = _Tp&&>
867 template<typename _Tp>
872 template<typename _Tp>
873 auto declval() noexcept -> decltype(__declval<_Tp>(0));
879 template<typename _Tp>
880 struct __is_array_known_bounds
884 template<
typename _Tp,
size_t _Size>
885 struct __is_array_known_bounds<_Tp[_Size]>
889 template<
typename _Tp>
890 struct __is_array_unknown_bounds
894 template<
typename _Tp>
895 struct __is_array_unknown_bounds<_Tp[]>
906 struct __do_is_destructible_impl
908 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
915 template<
typename _Tp>
916 struct __is_destructible_impl
917 :
public __do_is_destructible_impl
919 typedef decltype(__test<_Tp>(0)) type;
922 template<
typename _Tp,
923 bool = __or_<is_void<_Tp>,
924 __is_array_unknown_bounds<_Tp>,
925 is_function<_Tp>>::value,
926 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
927 struct __is_destructible_safe;
929 template<
typename _Tp>
930 struct __is_destructible_safe<_Tp, false, false>
931 :
public __is_destructible_impl<typename
932 remove_all_extents<_Tp>::type>::type
935 template<
typename _Tp>
936 struct __is_destructible_safe<_Tp, true, false>
939 template<
typename _Tp>
940 struct __is_destructible_safe<_Tp, false, true>
945 template<
typename _Tp>
947 :
public __is_destructible_safe<_Tp>::type
949 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
950 "template argument must be a complete class or an unbounded array");
959 struct __do_is_nt_destructible_impl
961 template<
typename _Tp>
962 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
969 template<
typename _Tp>
970 struct __is_nt_destructible_impl
971 :
public __do_is_nt_destructible_impl
973 typedef decltype(__test<_Tp>(0)) type;
976 template<
typename _Tp,
977 bool = __or_<is_void<_Tp>,
978 __is_array_unknown_bounds<_Tp>,
979 is_function<_Tp>>::value,
980 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
981 struct __is_nt_destructible_safe;
983 template<
typename _Tp>
984 struct __is_nt_destructible_safe<_Tp, false, false>
985 :
public __is_nt_destructible_impl<typename
986 remove_all_extents<_Tp>::type>::type
989 template<
typename _Tp>
990 struct __is_nt_destructible_safe<_Tp, true, false>
993 template<
typename _Tp>
994 struct __is_nt_destructible_safe<_Tp, false, true>
999 template<
typename _Tp>
1001 :
public __is_nt_destructible_safe<_Tp>::type
1003 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1004 "template argument must be a complete class or an unbounded array");
1008 template<
typename _Tp,
typename... _Args>
1009 using __is_constructible_impl
1010 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1014 template<
typename _Tp,
typename... _Args>
1016 :
public __is_constructible_impl<_Tp, _Args...>
1018 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1019 "template argument must be a complete class or an unbounded array");
1023 template<
typename _Tp>
1025 :
public __is_constructible_impl<_Tp>
1027 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1028 "template argument must be a complete class or an unbounded array");
1032 template<
typename _Tp,
typename =
void>
1033 struct __add_lvalue_reference_helper
1034 {
using type = _Tp; };
1036 template<
typename _Tp>
1037 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1038 {
using type = _Tp&; };
1040 template<
typename _Tp>
1041 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1045 template<
typename _Tp>
1047 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1049 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1050 "template argument must be a complete class or an unbounded array");
1054 template<
typename _Tp,
typename =
void>
1055 struct __add_rvalue_reference_helper
1056 {
using type = _Tp; };
1058 template<
typename _Tp>
1059 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1060 {
using type = _Tp&&; };
1062 template<
typename _Tp>
1063 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1067 template<
typename _Tp>
1069 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1071 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1072 "template argument must be a complete class or an unbounded array");
1076 template<
typename _Tp,
typename... _Args>
1077 using __is_nothrow_constructible_impl
1078 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1082 template<
typename _Tp,
typename... _Args>
1084 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1086 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1087 "template argument must be a complete class or an unbounded array");
1091 template<
typename _Tp>
1093 :
public __is_nothrow_constructible_impl<_Tp>
1095 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1096 "template argument must be a complete class or an unbounded array");
1100 template<
typename _Tp>
1102 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1104 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1105 "template argument must be a complete class or an unbounded array");
1109 template<
typename _Tp>
1111 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1113 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1114 "template argument must be a complete class or an unbounded array");
1118 template<
typename _Tp,
typename _Up>
1119 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1123 template<
typename _Tp,
typename _Up>
1125 :
public __is_assignable_impl<_Tp, _Up>
1127 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1128 "template argument must be a complete class or an unbounded array");
1132 template<
typename _Tp>
1134 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1135 __add_lval_ref_t<const _Tp>>
1137 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1138 "template argument must be a complete class or an unbounded array");
1142 template<
typename _Tp>
1144 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1146 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1147 "template argument must be a complete class or an unbounded array");
1151 template<
typename _Tp,
typename _Up>
1152 using __is_nothrow_assignable_impl
1153 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1157 template<
typename _Tp,
typename _Up>
1159 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1161 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1162 "template argument must be a complete class or an unbounded array");
1166 template<
typename _Tp>
1168 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1169 __add_lval_ref_t<const _Tp>>
1171 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1172 "template argument must be a complete class or an unbounded array");
1176 template<
typename _Tp>
1178 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1179 __add_rval_ref_t<_Tp>>
1181 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1182 "template argument must be a complete class or an unbounded array");
1186 template<
typename _Tp,
typename... _Args>
1187 using __is_trivially_constructible_impl
1188 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1192 template<
typename _Tp,
typename... _Args>
1194 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1196 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1197 "template argument must be a complete class or an unbounded array");
1201 template<
typename _Tp>
1203 :
public __is_trivially_constructible_impl<_Tp>
1205 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1206 "template argument must be a complete class or an unbounded array");
1209 struct __do_is_implicitly_default_constructible_impl
1211 template <
typename _Tp>
1212 static void __helper(
const _Tp&);
1214 template <
typename _Tp>
1216 decltype(__helper<const _Tp&>({}))* = 0);
1221 template<
typename _Tp>
1222 struct __is_implicitly_default_constructible_impl
1223 :
public __do_is_implicitly_default_constructible_impl
1225 typedef decltype(__test(declval<_Tp>())) type;
1228 template<
typename _Tp>
1229 struct __is_implicitly_default_constructible_safe
1230 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1233 template <
typename _Tp>
1234 struct __is_implicitly_default_constructible
1235 :
public __and_<__is_constructible_impl<_Tp>,
1236 __is_implicitly_default_constructible_safe<_Tp>>::type
1240 template<
typename _Tp>
1242 :
public __is_trivially_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_trivially_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_trivially_assignable_impl
1260 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1264 template<
typename _Tp,
typename _Up>
1266 :
public __is_trivially_assignable_impl<_Tp, _Up>
1268 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1269 "template argument must be a complete class or an unbounded array");
1273 template<
typename _Tp>
1275 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1276 __add_lval_ref_t<const _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 template<
typename _Tp>
1285 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1286 __add_rval_ref_t<_Tp>>
1288 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1289 "template argument must be a complete class or an unbounded array");
1293 template<
typename _Tp>
1295 :
public __and_<__is_destructible_safe<_Tp>,
1296 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1298 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1299 "template argument must be a complete class or an unbounded array");
1304 template<
typename _Tp>
1308 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1309 "template argument must be a complete class or an unbounded array");
1316 template<
typename _Tp>
1320 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1321 "template argument must be a complete class or an unbounded array");
1329 template<
typename _Tp, std::
size_t _Size>
1330 struct rank<_Tp[_Size]>
1333 template<
typename _Tp>
1335 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1338 template<
typename,
unsigned _U
int = 0>
1342 template<
typename _Tp,
size_t _Size>
1343 struct extent<_Tp[_Size], 0>
1346 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1347 struct extent<_Tp[_Size], _Uint>
1348 :
public extent<_Tp, _Uint - 1>::type { };
1350 template<
typename _Tp>
1351 struct extent<_Tp[], 0>
1352 :
public integral_constant<size_t, 0> { };
1354 template<
typename _Tp,
unsigned _U
int>
1355 struct extent<_Tp[], _Uint>
1356 :
public extent<_Tp, _Uint - 1>::type { };
1362 template<
typename _Tp,
typename _Up>
1364#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1371#ifndef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1372 template<
typename _Tp>
1379 template<
typename _Base,
typename _Derived>
1384#if __has_builtin(__is_convertible)
1385 template<
typename _From,
typename _To>
1386 struct is_convertible
1387 :
public __bool_constant<__is_convertible(_From, _To)>
1390 template<
typename _From,
typename _To,
1391 bool = __or_<is_void<_From>, is_function<_To>,
1392 is_array<_To>>::value>
1393 struct __is_convertible_helper
1395 typedef typename is_void<_To>::type type;
1398#pragma GCC diagnostic push
1399#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1400 template<
typename _From,
typename _To>
1401 class __is_convertible_helper<_From, _To, false>
1403 template<
typename _To1>
1404 static void __test_aux(_To1)
noexcept;
1406 template<
typename _From1,
typename _To1,
1407 typename =
decltype(__test_aux<_To1>(std::declval<_From1>()))>
1411 template<
typename,
typename>
1416 typedef decltype(__test<_From, _To>(0)) type;
1418#pragma GCC diagnostic pop
1421 template<
typename _From,
typename _To>
1422 struct is_convertible
1423 :
public __is_convertible_helper<_From, _To>::type
1428 template<
typename _ToElementType,
typename _FromElementType>
1429 using __is_array_convertible
1430 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1432#if __cplusplus >= 202002L
1433#define __cpp_lib_is_nothrow_convertible 201806L
1435#if __has_builtin(__is_nothrow_convertible)
1437 template<
typename _From,
typename _To>
1439 = __is_nothrow_convertible(_From, _To);
1442 template<
typename _From,
typename _To>
1444 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1447 template<
typename _From,
typename _To,
1450 struct __is_nt_convertible_helper
1454#pragma GCC diagnostic push
1455#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1456 template<
typename _From,
typename _To>
1457 class __is_nt_convertible_helper<_From, _To, false>
1459 template<
typename _To1>
1460 static void __test_aux(_To1)
noexcept;
1462 template<
typename _From1,
typename _To1>
1464 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1467 template<
typename,
typename>
1472 using type =
decltype(__test<_From, _To>(0));
1474#pragma GCC diagnostic pop
1477 template<
typename _From,
typename _To>
1478 struct is_nothrow_convertible
1479 :
public __is_nt_convertible_helper<_From, _To>::type
1483 template<
typename _From,
typename _To>
1485 = is_nothrow_convertible<_From, _To>::value;
1492 template<
typename _Tp>
1494 {
typedef _Tp type; };
1496 template<
typename _Tp>
1498 {
typedef _Tp type; };
1501 template<
typename _Tp>
1503 {
typedef _Tp type; };
1505 template<
typename _Tp>
1507 {
typedef _Tp type; };
1510 template<
typename _Tp>
1512 {
using type = _Tp; };
1514 template<
typename _Tp>
1516 {
using type = _Tp; };
1518 template<
typename _Tp>
1519 struct remove_cv<volatile _Tp>
1520 {
using type = _Tp; };
1522 template<
typename _Tp>
1523 struct remove_cv<const volatile _Tp>
1524 {
using type = _Tp; };
1527 template<
typename _Tp>
1529 {
using type = _Tp
const; };
1532 template<
typename _Tp>
1534 {
using type = _Tp
volatile; };
1537 template<
typename _Tp>
1539 {
using type = _Tp
const volatile; };
1541#if __cplusplus > 201103L
1543#define __cpp_lib_transformation_trait_aliases 201304L
1546 template<
typename _Tp>
1550 template<
typename _Tp>
1554 template<
typename _Tp>
1558 template<
typename _Tp>
1562 template<
typename _Tp>
1566 template<
typename _Tp>
1573 template<
typename _Tp>
1575 {
typedef _Tp type; };
1577 template<
typename _Tp>
1579 {
typedef _Tp type; };
1581 template<
typename _Tp>
1582 struct remove_reference<_Tp&&>
1583 {
typedef _Tp type; };
1586 template<
typename _Tp>
1588 {
using type = __add_lval_ref_t<_Tp>; };
1591 template<
typename _Tp>
1593 {
using type = __add_rval_ref_t<_Tp>; };
1595#if __cplusplus > 201103L
1597 template<
typename _Tp>
1601 template<
typename _Tp>
1605 template<
typename _Tp>
1614 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1615 struct __cv_selector;
1617 template<
typename _Unqualified>
1618 struct __cv_selector<_Unqualified, false, false>
1619 {
typedef _Unqualified __type; };
1621 template<
typename _Unqualified>
1622 struct __cv_selector<_Unqualified, false, true>
1623 {
typedef volatile _Unqualified __type; };
1625 template<
typename _Unqualified>
1626 struct __cv_selector<_Unqualified, true, false>
1627 {
typedef const _Unqualified __type; };
1629 template<
typename _Unqualified>
1630 struct __cv_selector<_Unqualified, true, true>
1631 {
typedef const volatile _Unqualified __type; };
1633 template<
typename _Qualified,
typename _Unqualified,
1634 bool _IsConst = is_const<_Qualified>::value,
1635 bool _IsVol = is_volatile<_Qualified>::value>
1636 class __match_cv_qualifiers
1638 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1641 typedef typename __match::__type __type;
1645 template<
typename _Tp>
1646 struct __make_unsigned
1647 {
typedef _Tp __type; };
1650 struct __make_unsigned<char>
1651 {
typedef unsigned char __type; };
1654 struct __make_unsigned<signed char>
1655 {
typedef unsigned char __type; };
1658 struct __make_unsigned<short>
1659 {
typedef unsigned short __type; };
1662 struct __make_unsigned<int>
1663 {
typedef unsigned int __type; };
1666 struct __make_unsigned<long>
1667 {
typedef unsigned long __type; };
1670 struct __make_unsigned<long long>
1671 {
typedef unsigned long long __type; };
1673#if defined(__GLIBCXX_TYPE_INT_N_0)
1676 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1677 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1679#if defined(__GLIBCXX_TYPE_INT_N_1)
1682 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1683 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1685#if defined(__GLIBCXX_TYPE_INT_N_2)
1688 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1689 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1691#if defined(__GLIBCXX_TYPE_INT_N_3)
1694 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1695 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1699 template<
typename _Tp,
1700 bool _IsInt = is_integral<_Tp>::value,
1701 bool _IsEnum = is_enum<_Tp>::value>
1702 class __make_unsigned_selector;
1704 template<
typename _Tp>
1705 class __make_unsigned_selector<_Tp, true, false>
1707 using __unsigned_type
1708 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1712 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1715 class __make_unsigned_selector_base
1718 template<
typename...>
struct _List { };
1720 template<
typename _Tp,
typename... _Up>
1721 struct _List<_Tp, _Up...> : _List<_Up...>
1722 {
static constexpr size_t __size =
sizeof(_Tp); };
1724 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1727 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1728 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1729 {
using __type = _Uint; };
1731 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1732 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1733 : __select<_Sz, _List<_UInts...>>
1738 template<
typename _Tp>
1739 class __make_unsigned_selector<_Tp, false, true>
1740 : __make_unsigned_selector_base
1743 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1744 unsigned long,
unsigned long long>;
1746 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1750 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1758 struct __make_unsigned<wchar_t>
1761 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1764#ifdef _GLIBCXX_USE_CHAR8_T
1766 struct __make_unsigned<char8_t>
1769 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1774 struct __make_unsigned<char16_t>
1777 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1781 struct __make_unsigned<char32_t>
1784 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1792 template<
typename _Tp>
1794 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1803 template<
typename _Tp>
1804 struct __make_signed
1805 {
typedef _Tp __type; };
1808 struct __make_signed<char>
1809 {
typedef signed char __type; };
1812 struct __make_signed<unsigned char>
1813 {
typedef signed char __type; };
1816 struct __make_signed<unsigned short>
1817 {
typedef signed short __type; };
1820 struct __make_signed<unsigned int>
1821 {
typedef signed int __type; };
1824 struct __make_signed<unsigned long>
1825 {
typedef signed long __type; };
1828 struct __make_signed<unsigned long long>
1829 {
typedef signed long long __type; };
1831#if defined(__GLIBCXX_TYPE_INT_N_0)
1834 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1835 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1837#if defined(__GLIBCXX_TYPE_INT_N_1)
1840 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1841 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1843#if defined(__GLIBCXX_TYPE_INT_N_2)
1846 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1847 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1849#if defined(__GLIBCXX_TYPE_INT_N_3)
1852 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1853 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1857 template<
typename _Tp,
1858 bool _IsInt = is_integral<_Tp>::value,
1859 bool _IsEnum = is_enum<_Tp>::value>
1860 class __make_signed_selector;
1862 template<
typename _Tp>
1863 class __make_signed_selector<_Tp, true, false>
1866 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1870 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1874 template<
typename _Tp>
1875 class __make_signed_selector<_Tp, false, true>
1877 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1880 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1888 struct __make_signed<wchar_t>
1891 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1894#if defined(_GLIBCXX_USE_CHAR8_T)
1896 struct __make_signed<char8_t>
1899 =
typename __make_signed_selector<char8_t, false, true>::__type;
1904 struct __make_signed<char16_t>
1907 =
typename __make_signed_selector<char16_t, false, true>::__type;
1911 struct __make_signed<char32_t>
1914 =
typename __make_signed_selector<char32_t, false, true>::__type;
1922 template<
typename _Tp>
1924 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1930#if __cplusplus > 201103L
1932 template<
typename _Tp>
1936 template<
typename _Tp>
1943 template<
typename _Tp>
1945 {
typedef _Tp type; };
1947 template<
typename _Tp, std::
size_t _Size>
1949 {
typedef _Tp type; };
1951 template<
typename _Tp>
1952 struct remove_extent<_Tp[]>
1953 {
typedef _Tp type; };
1956 template<
typename _Tp>
1958 {
typedef _Tp type; };
1960 template<
typename _Tp, std::
size_t _Size>
1962 {
typedef typename remove_all_extents<_Tp>::type type; };
1964 template<
typename _Tp>
1965 struct remove_all_extents<_Tp[]>
1966 {
typedef typename remove_all_extents<_Tp>::type type; };
1968#if __cplusplus > 201103L
1970 template<
typename _Tp>
1974 template<
typename _Tp>
1980 template<
typename _Tp,
typename>
1981 struct __remove_pointer_helper
1982 {
typedef _Tp type; };
1984 template<
typename _Tp,
typename _Up>
1985 struct __remove_pointer_helper<_Tp, _Up*>
1986 {
typedef _Up type; };
1989 template<
typename _Tp>
1991 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
1994 template<
typename _Tp,
typename =
void>
1995 struct __add_pointer_helper
1996 {
using type = _Tp; };
1998 template<
typename _Tp>
1999 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2000 {
using type = _Tp*; };
2003 template<
typename _Tp>
2005 :
public __add_pointer_helper<_Tp>
2008 template<
typename _Tp>
2010 {
using type = _Tp*; };
2012 template<
typename _Tp>
2013 struct add_pointer<_Tp&&>
2014 {
using type = _Tp*; };
2016#if __cplusplus > 201103L
2018 template<
typename _Tp>
2022 template<
typename _Tp>
2026 template<std::
size_t _Len>
2027 struct __aligned_storage_msa
2031 unsigned char __data[_Len];
2032 struct __attribute__((__aligned__)) { } __align;
2046 template<std::size_t _Len, std::size_t _Align =
2047 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2052 unsigned char __data[_Len];
2053 struct __attribute__((__aligned__((_Align)))) { } __align;
2057 template <
typename... _Types>
2058 struct __strictest_alignment
2060 static const size_t _S_alignment = 0;
2061 static const size_t _S_size = 0;
2064 template <
typename _Tp,
typename... _Types>
2065 struct __strictest_alignment<_Tp, _Types...>
2067 static const size_t _S_alignment =
2068 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2069 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2070 static const size_t _S_size =
2071 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2072 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2085 template <
size_t _Len,
typename... _Types>
2089 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2091 using __strictest = __strictest_alignment<_Types...>;
2092 static const size_t _S_len = _Len > __strictest::_S_size
2093 ? _Len : __strictest::_S_size;
2101 template <
size_t _Len,
typename... _Types>
2102 const size_t aligned_union<_Len, _Types...>::alignment_value;
2108 template<
typename _Up>
2109 struct __decay_selector
2110 : __conditional_t<is_const<const _Up>::value,
2115 template<
typename _Up,
size_t _Nm>
2116 struct __decay_selector<_Up[_Nm]>
2117 {
using type = _Up*; };
2119 template<
typename _Up>
2120 struct __decay_selector<_Up[]>
2121 {
using type = _Up*; };
2126 template<
typename _Tp>
2128 {
using type =
typename __decay_selector<_Tp>::type; };
2130 template<
typename _Tp>
2132 {
using type =
typename __decay_selector<_Tp>::type; };
2134 template<
typename _Tp>
2136 {
using type =
typename __decay_selector<_Tp>::type; };
2141 template<
typename _Tp>
2142 struct __strip_reference_wrapper
2147 template<
typename _Tp>
2148 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2150 typedef _Tp& __type;
2154 template<
typename _Tp>
2155 using __decay_t =
typename decay<_Tp>::type;
2157 template<
typename _Tp>
2158 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2164 template<
typename... _Cond>
2165 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2168 template<
typename _Tp>
2169 using __remove_cvref_t
2170 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2175 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2177 {
typedef _Iftrue type; };
2180 template<
typename _Iftrue,
typename _Iffalse>
2182 {
typedef _Iffalse type; };
2185 template<
typename... _Tp>
2197 template<
typename _Tp>
2198 struct __success_type
2199 {
typedef _Tp type; };
2201 struct __failure_type
2204 struct __do_common_type_impl
2206 template<
typename _Tp,
typename _Up>
2208 =
decltype(
true ? std::declval<_Tp>() :
std::
declval<_Up>());
2212 template<
typename _Tp,
typename _Up>
2213 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2216#if __cplusplus > 201703L
2219 template<
typename _Tp,
typename _Up>
2220 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2224 template<
typename,
typename>
2225 static __failure_type
2228 template<
typename _Tp,
typename _Up>
2229 static decltype(_S_test_2<_Tp, _Up>(0))
2235 struct common_type<>
2239 template<
typename _Tp0>
2240 struct common_type<_Tp0>
2241 :
public common_type<_Tp0, _Tp0>
2245 template<
typename _Tp1,
typename _Tp2,
2246 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2247 struct __common_type_impl
2251 using type = common_type<_Dp1, _Dp2>;
2254 template<
typename _Tp1,
typename _Tp2>
2255 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2256 :
private __do_common_type_impl
2260 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2264 template<
typename _Tp1,
typename _Tp2>
2265 struct common_type<_Tp1, _Tp2>
2266 :
public __common_type_impl<_Tp1, _Tp2>::type
2269 template<
typename...>
2270 struct __common_type_pack
2273 template<
typename,
typename,
typename =
void>
2274 struct __common_type_fold;
2277 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2278 struct common_type<_Tp1, _Tp2, _Rp...>
2279 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2280 __common_type_pack<_Rp...>>
2286 template<
typename _CTp,
typename... _Rp>
2287 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2288 __void_t<typename _CTp::type>>
2289 :
public common_type<typename _CTp::type, _Rp...>
2293 template<
typename _CTp,
typename _Rp>
2294 struct __common_type_fold<_CTp, _Rp, void>
2297 template<typename _Tp, bool = is_enum<_Tp>::value>
2298 struct __underlying_type_impl
2300 using type = __underlying_type(_Tp);
2303 template<
typename _Tp>
2304 struct __underlying_type_impl<_Tp, false>
2309 template<
typename _Tp>
2311 :
public __underlying_type_impl<_Tp>
2315 template<
typename _Tp>
2316 struct __declval_protector
2318 static const bool __stop =
false;
2326 template<
typename _Tp>
2327 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2329 static_assert(__declval_protector<_Tp>::__stop,
2330 "declval() must not be used!");
2331 return __declval<_Tp>(0);
2335 template<
typename _Signature>
2340#define __cpp_lib_result_of_sfinae 201210L
2343 struct __invoke_memfun_ref { };
2344 struct __invoke_memfun_deref { };
2345 struct __invoke_memobj_ref { };
2346 struct __invoke_memobj_deref { };
2347 struct __invoke_other { };
2350 template<
typename _Tp,
typename _Tag>
2351 struct __result_of_success : __success_type<_Tp>
2352 {
using __invoke_type = _Tag; };
2355 struct __result_of_memfun_ref_impl
2357 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2358 static __result_of_success<
decltype(
2359 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2360 ), __invoke_memfun_ref> _S_test(
int);
2362 template<
typename...>
2363 static __failure_type _S_test(...);
2366 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2367 struct __result_of_memfun_ref
2368 :
private __result_of_memfun_ref_impl
2370 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2374 struct __result_of_memfun_deref_impl
2376 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2377 static __result_of_success<
decltype(
2378 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2379 ), __invoke_memfun_deref> _S_test(
int);
2381 template<
typename...>
2382 static __failure_type _S_test(...);
2385 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2386 struct __result_of_memfun_deref
2387 :
private __result_of_memfun_deref_impl
2389 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2393 struct __result_of_memobj_ref_impl
2395 template<
typename _Fp,
typename _Tp1>
2396 static __result_of_success<
decltype(
2397 std::declval<_Tp1>().*std::declval<_Fp>()
2398 ), __invoke_memobj_ref> _S_test(
int);
2400 template<
typename,
typename>
2401 static __failure_type _S_test(...);
2404 template<
typename _MemPtr,
typename _Arg>
2405 struct __result_of_memobj_ref
2406 :
private __result_of_memobj_ref_impl
2408 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2412 struct __result_of_memobj_deref_impl
2414 template<
typename _Fp,
typename _Tp1>
2415 static __result_of_success<
decltype(
2416 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2417 ), __invoke_memobj_deref> _S_test(
int);
2419 template<
typename,
typename>
2420 static __failure_type _S_test(...);
2423 template<
typename _MemPtr,
typename _Arg>
2424 struct __result_of_memobj_deref
2425 :
private __result_of_memobj_deref_impl
2427 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2430 template<
typename _MemPtr,
typename _Arg>
2431 struct __result_of_memobj;
2433 template<
typename _Res,
typename _Class,
typename _Arg>
2434 struct __result_of_memobj<_Res _Class::*, _Arg>
2436 typedef __remove_cvref_t<_Arg> _Argval;
2437 typedef _Res _Class::* _MemPtr;
2438 typedef typename __conditional_t<__or_<is_same<_Argval, _Class>,
2439 is_base_of<_Class, _Argval>>::value,
2440 __result_of_memobj_ref<_MemPtr, _Arg>,
2441 __result_of_memobj_deref<_MemPtr, _Arg>
2445 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2446 struct __result_of_memfun;
2448 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2449 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2451 typedef typename remove_reference<_Arg>::type _Argval;
2452 typedef _Res _Class::* _MemPtr;
2453 typedef typename __conditional_t<is_base_of<_Class, _Argval>::value,
2454 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2455 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2464 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2470 template<
typename _Tp,
typename _Up>
2471 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2476 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2477 struct __result_of_impl
2479 typedef __failure_type type;
2482 template<
typename _MemPtr,
typename _Arg>
2483 struct __result_of_impl<true, false, _MemPtr, _Arg>
2484 :
public __result_of_memobj<__decay_t<_MemPtr>,
2485 typename __inv_unwrap<_Arg>::type>
2488 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2489 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2490 :
public __result_of_memfun<__decay_t<_MemPtr>,
2491 typename __inv_unwrap<_Arg>::type, _Args...>
2495 struct __result_of_other_impl
2497 template<
typename _Fn,
typename... _Args>
2498 static __result_of_success<
decltype(
2499 std::declval<_Fn>()(std::declval<_Args>()...)
2500 ), __invoke_other> _S_test(
int);
2502 template<
typename...>
2503 static __failure_type _S_test(...);
2506 template<
typename _Functor,
typename... _ArgTypes>
2507 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2508 :
private __result_of_other_impl
2510 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2514 template<typename _Functor, typename... _ArgTypes>
2515 struct __invoke_result
2516 : public __result_of_impl<
2517 is_member_object_pointer<
2518 typename remove_reference<_Functor>::type
2520 is_member_function_pointer<
2521 typename remove_reference<_Functor>::type
2523 _Functor, _ArgTypes...
2528 template<
typename _Functor,
typename... _ArgTypes>
2529 struct result_of<_Functor(_ArgTypes...)>
2530 :
public __invoke_result<_Functor, _ArgTypes...>
2531 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2533#if __cplusplus >= 201402L
2535 template<
size_t _Len,
size_t _Align =
2536 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2539 template <
size_t _Len,
typename... _Types>
2540 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2543 template<
typename _Tp>
2547 template<
bool _Cond,
typename _Tp =
void>
2551 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2555 template<
typename... _Tp>
2559 template<
typename _Tp>
2563 template<
typename _Tp>
2567#if __cplusplus >= 201703L || !defined(__STRICT_ANSI__)
2568#define __cpp_lib_void_t 201411L
2580 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2581 struct __detected_or
2588 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2589 requires requires {
typename _Op<_Args...>; }
2590 struct __detected_or<_Def, _Op, _Args...>
2592 using type = _Op<_Args...>;
2597 template<
typename _Default,
typename _AlwaysVoid,
2598 template<
typename...>
class _Op,
typename... _Args>
2601 using type = _Default;
2606 template<
typename _Default,
template<
typename...>
class _Op,
2608 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2610 using type = _Op<_Args...>;
2614 template<
typename _Default,
template<
typename...>
class _Op,
2616 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2620 template<
typename _Default,
template<
typename...>
class _Op,
2622 using __detected_or_t
2623 =
typename __detected_or<_Default, _Op, _Args...>::type;
2629#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2630 template<typename _Tp, typename = __void_t<>> \
2631 struct __has_##_NTYPE \
2634 template<typename _Tp> \
2635 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2639 template <
typename _Tp>
2640 struct __is_swappable;
2642 template <
typename _Tp>
2643 struct __is_nothrow_swappable;
2650 template<
typename _Tp>
2651 struct __is_tuple_like
2652 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2656 template<
typename _Tp>
2657 _GLIBCXX20_CONSTEXPR
2659 _Require<__not_<__is_tuple_like<_Tp>>,
2660 is_move_constructible<_Tp>,
2661 is_move_assignable<_Tp>>
2663 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2664 is_nothrow_move_assignable<_Tp>>::value);
2666 template<
typename _Tp,
size_t _Nm>
2667 _GLIBCXX20_CONSTEXPR
2669 __enable_if_t<__is_swappable<_Tp>::value>
2670 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2671 noexcept(__is_nothrow_swappable<_Tp>::value);
2674 namespace __swappable_details {
2677 struct __do_is_swappable_impl
2679 template<
typename _Tp,
typename
2680 =
decltype(
swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2687 struct __do_is_nothrow_swappable_impl
2689 template<
typename _Tp>
2690 static __bool_constant<
2691 noexcept(
swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2700 template<
typename _Tp>
2701 struct __is_swappable_impl
2702 :
public __swappable_details::__do_is_swappable_impl
2704 typedef decltype(__test<_Tp>(0)) type;
2707 template<
typename _Tp>
2708 struct __is_nothrow_swappable_impl
2709 :
public __swappable_details::__do_is_nothrow_swappable_impl
2711 typedef decltype(__test<_Tp>(0)) type;
2714 template<
typename _Tp>
2715 struct __is_swappable
2716 :
public __is_swappable_impl<_Tp>::type
2719 template<
typename _Tp>
2720 struct __is_nothrow_swappable
2721 :
public __is_nothrow_swappable_impl<_Tp>::type
2725#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
2726#define __cpp_lib_is_swappable 201603L
2730 template<
typename _Tp>
2732 :
public __is_swappable_impl<_Tp>::type
2734 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2735 "template argument must be a complete class or an unbounded array");
2739 template<
typename _Tp>
2741 :
public __is_nothrow_swappable_impl<_Tp>::type
2743 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2744 "template argument must be a complete class or an unbounded array");
2747#if __cplusplus >= 201402L
2749 template<
typename _Tp>
2754 template<
typename _Tp>
2760 namespace __swappable_with_details {
2763 struct __do_is_swappable_with_impl
2765 template<
typename _Tp,
typename _Up,
typename
2766 =
decltype(
swap(std::declval<_Tp>(), std::declval<_Up>())),
2768 =
decltype(
swap(std::declval<_Up>(), std::declval<_Tp>()))>
2771 template<
typename,
typename>
2775 struct __do_is_nothrow_swappable_with_impl
2777 template<
typename _Tp,
typename _Up>
2778 static __bool_constant<
2779 noexcept(
swap(std::declval<_Tp>(), std::declval<_Up>()))
2781 noexcept(
swap(std::declval<_Up>(), std::declval<_Tp>()))
2784 template<
typename,
typename>
2790 template<
typename _Tp,
typename _Up>
2791 struct __is_swappable_with_impl
2792 :
public __swappable_with_details::__do_is_swappable_with_impl
2794 typedef decltype(__test<_Tp, _Up>(0)) type;
2798 template<
typename _Tp>
2799 struct __is_swappable_with_impl<_Tp&, _Tp&>
2800 :
public __swappable_details::__do_is_swappable_impl
2802 typedef decltype(__test<_Tp&>(0)) type;
2805 template<
typename _Tp,
typename _Up>
2806 struct __is_nothrow_swappable_with_impl
2807 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2809 typedef decltype(__test<_Tp, _Up>(0)) type;
2813 template<
typename _Tp>
2814 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2815 :
public __swappable_details::__do_is_nothrow_swappable_impl
2817 typedef decltype(__test<_Tp&>(0)) type;
2822 template<
typename _Tp,
typename _Up>
2824 :
public __is_swappable_with_impl<_Tp, _Up>::type
2826 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2827 "first template argument must be a complete class or an unbounded array");
2828 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2829 "second template argument must be a complete class or an unbounded array");
2833 template<
typename _Tp,
typename _Up>
2835 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2837 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2838 "first template argument must be a complete class or an unbounded array");
2839 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2840 "second template argument must be a complete class or an unbounded array");
2843#if __cplusplus >= 201402L
2845 template<
typename _Tp,
typename _Up>
2850 template<
typename _Tp,
typename _Up>
2862 template<
typename _Result,
typename _Ret,
2864 struct __is_invocable_impl
2871 template<
typename _Result,
typename _Ret>
2872 struct __is_invocable_impl<_Result, _Ret,
2874 __void_t<typename _Result::type>>
2880#pragma GCC diagnostic push
2881#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2883 template<
typename _Result,
typename _Ret>
2884 struct __is_invocable_impl<_Result, _Ret,
2886 __void_t<typename _Result::type>>
2890 using _Res_t =
typename _Result::type;
2894 static _Res_t _S_get() noexcept;
2897 template<typename _Tp>
2898 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
2901 template<typename _Tp,
2902 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
2903 typename = decltype(_S_conv<_Tp>(_S_get())),
2904#if __has_builtin(__reference_converts_from_temporary)
2905 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
2907 bool _Dangle =
false
2910 static __bool_constant<_Nothrow && !_Dangle>
2913 template<
typename _Tp,
bool = false>
2919 using type =
decltype(_S_test<_Ret,
true>(1));
2922 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
2924#pragma GCC diagnostic pop
2926 template<
typename _Fn,
typename... _ArgTypes>
2927 struct __is_invocable
2928 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2931 template<
typename _Fn,
typename _Tp,
typename... _Args>
2932 constexpr bool __call_is_nt(__invoke_memfun_ref)
2934 using _Up =
typename __inv_unwrap<_Tp>::type;
2935 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2936 std::declval<_Args>()...));
2939 template<
typename _Fn,
typename _Tp,
typename... _Args>
2940 constexpr bool __call_is_nt(__invoke_memfun_deref)
2942 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2943 std::declval<_Args>()...));
2946 template<
typename _Fn,
typename _Tp>
2947 constexpr bool __call_is_nt(__invoke_memobj_ref)
2949 using _Up =
typename __inv_unwrap<_Tp>::type;
2950 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2953 template<
typename _Fn,
typename _Tp>
2954 constexpr bool __call_is_nt(__invoke_memobj_deref)
2956 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2959 template<
typename _Fn,
typename... _Args>
2960 constexpr bool __call_is_nt(__invoke_other)
2962 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2965 template<
typename _Result,
typename _Fn,
typename... _Args>
2966 struct __call_is_nothrow
2968 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2972 template<
typename _Fn,
typename... _Args>
2973 using __call_is_nothrow_
2974 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2977 template<
typename _Fn,
typename... _Args>
2978 struct __is_nothrow_invocable
2979 : __and_<__is_invocable<_Fn, _Args...>,
2980 __call_is_nothrow_<_Fn, _Args...>>::type
2983#pragma GCC diagnostic push
2984#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2985 struct __nonesuchbase {};
2986 struct __nonesuch :
private __nonesuchbase {
2987 ~__nonesuch() =
delete;
2988 __nonesuch(__nonesuch
const&) =
delete;
2989 void operator=(__nonesuch
const&) =
delete;
2991#pragma GCC diagnostic pop
2994#if __cplusplus >= 201703L
2995# define __cpp_lib_is_invocable 201703L
2998 template<
typename _Functor,
typename... _ArgTypes>
3000 :
public __invoke_result<_Functor, _ArgTypes...>
3002 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3003 "_Functor must be a complete class or an unbounded array");
3004 static_assert((std::__is_complete_or_unbounded(
3005 __type_identity<_ArgTypes>{}) && ...),
3006 "each argument type must be a complete class or an unbounded array");
3010 template<
typename _Fn,
typename... _Args>
3014 template<
typename _Fn,
typename... _ArgTypes>
3016 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3018 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3019 "_Fn must be a complete class or an unbounded array");
3020 static_assert((std::__is_complete_or_unbounded(
3021 __type_identity<_ArgTypes>{}) && ...),
3022 "each argument type must be a complete class or an unbounded array");
3026 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3028 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3030 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3031 "_Fn must be a complete class or an unbounded array");
3032 static_assert((std::__is_complete_or_unbounded(
3033 __type_identity<_ArgTypes>{}) && ...),
3034 "each argument type must be a complete class or an unbounded array");
3035 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3036 "_Ret must be a complete class or an unbounded array");
3040 template<
typename _Fn,
typename... _ArgTypes>
3042 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3043 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3045 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3046 "_Fn must be a complete class or an unbounded array");
3047 static_assert((std::__is_complete_or_unbounded(
3048 __type_identity<_ArgTypes>{}) && ...),
3049 "each argument type must be a complete class or an unbounded array");
3056 template<
typename _Result,
typename _Ret>
3057 using __is_nt_invocable_impl
3058 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3062 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3064 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3065 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3067 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3068 "_Fn must be a complete class or an unbounded array");
3069 static_assert((std::__is_complete_or_unbounded(
3070 __type_identity<_ArgTypes>{}) && ...),
3071 "each argument type must be a complete class or an unbounded array");
3072 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3073 "_Ret must be a complete class or an unbounded array");
3077#if __cplusplus >= 201703L
3078# define __cpp_lib_type_trait_variable_templates 201510L
3093template <
typename _Tp>
3095template <
typename _Tp>
3097template <
typename _Tp>
3099template <
typename _Tp>
3102template <
typename _Tp>
3103 inline constexpr bool is_array_v =
false;
3104template <
typename _Tp>
3105 inline constexpr bool is_array_v<_Tp[]> =
true;
3106template <
typename _Tp,
size_t _Num>
3107 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3109template <
typename _Tp>
3111template <
typename _Tp>
3112 inline constexpr bool is_lvalue_reference_v =
false;
3113template <
typename _Tp>
3114 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3115template <
typename _Tp>
3116 inline constexpr bool is_rvalue_reference_v =
false;
3117template <
typename _Tp>
3118 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3119template <
typename _Tp>
3120 inline constexpr bool is_member_object_pointer_v =
3122template <
typename _Tp>
3123 inline constexpr bool is_member_function_pointer_v =
3125template <
typename _Tp>
3126 inline constexpr bool is_enum_v = __is_enum(_Tp);
3127template <
typename _Tp>
3128 inline constexpr bool is_union_v = __is_union(_Tp);
3129template <
typename _Tp>
3130 inline constexpr bool is_class_v = __is_class(_Tp);
3131template <
typename _Tp>
3133template <
typename _Tp>
3134 inline constexpr bool is_reference_v =
false;
3135template <
typename _Tp>
3136 inline constexpr bool is_reference_v<_Tp&> =
true;
3137template <
typename _Tp>
3138 inline constexpr bool is_reference_v<_Tp&&> =
true;
3139template <
typename _Tp>
3141template <
typename _Tp>
3143template <
typename _Tp>
3145template <
typename _Tp>
3147template <
typename _Tp>
3149template <
typename _Tp>
3151template <
typename _Tp>
3152 inline constexpr bool is_const_v =
false;
3153template <
typename _Tp>
3154 inline constexpr bool is_const_v<const _Tp> =
true;
3155template <
typename _Tp>
3156 inline constexpr bool is_volatile_v =
false;
3157template <
typename _Tp>
3158 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3160template <
typename _Tp>
3161 inline constexpr bool is_trivial_v = __is_trivial(_Tp);
3162template <
typename _Tp>
3163 inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3164template <
typename _Tp>
3165 inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
3166template <
typename _Tp>
3167 _GLIBCXX20_DEPRECATED(
"use is_standard_layout_v && is_trivial_v instead")
3168 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3169template <typename _Tp>
3170 _GLIBCXX17_DEPRECATED
3171 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3172template <typename _Tp>
3173 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3174template <typename _Tp>
3175 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3176template <typename _Tp>
3177 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3178template <typename _Tp>
3179 inline constexpr
bool is_final_v = __is_final(_Tp);
3181template <typename _Tp>
3182 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3183template <typename _Tp>
3184 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3186template <typename _Tp, typename... _Args>
3187 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3188template <typename _Tp>
3189 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3190template <typename _Tp>
3191 inline constexpr
bool is_copy_constructible_v
3192 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3193template <typename _Tp>
3194 inline constexpr
bool is_move_constructible_v
3195 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3197template <typename _Tp, typename _Up>
3198 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3199template <typename _Tp>
3200 inline constexpr
bool is_copy_assignable_v
3201 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3202template <typename _Tp>
3203 inline constexpr
bool is_move_assignable_v
3204 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3206template <typename _Tp>
3207 inline constexpr
bool is_destructible_v =
is_destructible<_Tp>::value;
3209template <typename _Tp, typename... _Args>
3210 inline constexpr
bool is_trivially_constructible_v
3211 = __is_trivially_constructible(_Tp, _Args...);
3212template <typename _Tp>
3213 inline constexpr
bool is_trivially_default_constructible_v
3214 = __is_trivially_constructible(_Tp);
3215template <typename _Tp>
3216 inline constexpr
bool is_trivially_copy_constructible_v
3217 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3218template <typename _Tp>
3219 inline constexpr
bool is_trivially_move_constructible_v
3220 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3222template <typename _Tp, typename _Up>
3223 inline constexpr
bool is_trivially_assignable_v
3224 = __is_trivially_assignable(_Tp, _Up);
3225template <typename _Tp>
3226 inline constexpr
bool is_trivially_copy_assignable_v
3227 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3228 __add_lval_ref_t<const _Tp>);
3229template <typename _Tp>
3230 inline constexpr
bool is_trivially_move_assignable_v
3231 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3232 __add_rval_ref_t<_Tp>);
3233template <typename _Tp>
3234 inline constexpr
bool is_trivially_destructible_v =
3236template <typename _Tp, typename... _Args>
3237 inline constexpr
bool is_nothrow_constructible_v
3238 = __is_nothrow_constructible(_Tp, _Args...);
3239template <typename _Tp>
3240 inline constexpr
bool is_nothrow_default_constructible_v
3241 = __is_nothrow_constructible(_Tp);
3242template <typename _Tp>
3243 inline constexpr
bool is_nothrow_copy_constructible_v
3244 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3245template <typename _Tp>
3246 inline constexpr
bool is_nothrow_move_constructible_v
3247 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3249template <typename _Tp, typename _Up>
3250 inline constexpr
bool is_nothrow_assignable_v
3251 = __is_nothrow_assignable(_Tp, _Up);
3252template <typename _Tp>
3253 inline constexpr
bool is_nothrow_copy_assignable_v
3254 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3255 __add_lval_ref_t<const _Tp>);
3256template <typename _Tp>
3257 inline constexpr
bool is_nothrow_move_assignable_v
3258 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3260template <typename _Tp>
3261 inline constexpr
bool is_nothrow_destructible_v =
3264template <typename _Tp>
3265 inline constexpr
bool has_virtual_destructor_v
3266 = __has_virtual_destructor(_Tp);
3268template <typename _Tp>
3269 inline constexpr
size_t alignment_of_v =
alignment_of<_Tp>::value;
3271template <typename _Tp>
3272 inline constexpr
size_t rank_v = 0;
3273template <typename _Tp,
size_t _Size>
3274 inline constexpr
size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3275template <typename _Tp>
3276 inline constexpr
size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3278template <typename _Tp,
unsigned _Idx = 0>
3279 inline constexpr
size_t extent_v = 0;
3280template <typename _Tp,
size_t _Size>
3281 inline constexpr
size_t extent_v<_Tp[_Size], 0> = _Size;
3282template <typename _Tp,
unsigned _Idx,
size_t _Size>
3283 inline constexpr
size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3284template <typename _Tp>
3285 inline constexpr
size_t extent_v<_Tp[], 0> = 0;
3286template <typename _Tp,
unsigned _Idx>
3287 inline constexpr
size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3289#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
3290template <
typename _Tp,
typename _Up>
3291 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3293template <
typename _Tp,
typename _Up>
3294 inline constexpr bool is_same_v =
false;
3295template <
typename _Tp>
3296 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3298template <
typename _Base,
typename _Derived>
3299 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3300template <
typename _From,
typename _To>
3301 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3302template<
typename _Fn,
typename... _Args>
3303 inline constexpr bool is_invocable_v =
is_invocable<_Fn, _Args...>::value;
3304template<
typename _Fn,
typename... _Args>
3305 inline constexpr bool is_nothrow_invocable_v
3307template<
typename _Ret,
typename _Fn,
typename... _Args>
3308 inline constexpr bool is_invocable_r_v
3310template<
typename _Ret,
typename _Fn,
typename... _Args>
3311 inline constexpr bool is_nothrow_invocable_r_v
3315#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3316# define __cpp_lib_has_unique_object_representations 201606L
3319 template<
typename _Tp>
3322 remove_cv_t<remove_all_extents_t<_Tp>>
3325 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3326 "template argument must be a complete class or an unbounded array");
3330 template<
typename _Tp>
3331 inline constexpr bool has_unique_object_representations_v
3335#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3336# define __cpp_lib_is_aggregate 201703L
3339 template<
typename _Tp>
3348 template<
typename _Tp>
3353#if __cplusplus >= 202002L
3359#define __cpp_lib_remove_cvref 201711L
3361 template<
typename _Tp>
3366 template<
typename _Tp>
3367 struct remove_cvref<_Tp&>
3371 template<
typename _Tp>
3372 struct remove_cvref<_Tp&&>
3376 template<
typename _Tp>
3384#define __cpp_lib_type_identity 201806L
3385 template<
typename _Tp>
3386 struct type_identity {
using type = _Tp; };
3388 template<
typename _Tp>
3392#define __cpp_lib_unwrap_ref 201811L
3398 template<
typename _Tp>
3401 template<
typename _Tp>
3404 template<
typename _Tp>
3405 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3412 template<
typename _Tp>
3415 template<
typename _Tp>
3416 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3419#define __cpp_lib_bounded_array_traits 201902L
3424 template<
typename _Tp>
3427 template<
typename _Tp,
size_t _Size>
3428 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
3433 template<
typename _Tp>
3436 template<
typename _Tp>
3437 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
3441 template<
typename _Tp>
3448 template<
typename _Tp>
3453#if __has_builtin(__is_layout_compatible)
3456 template<
typename _Tp,
typename _Up>
3463 template<
typename _Tp,
typename _Up>
3465 = __is_layout_compatible(_Tp, _Up);
3467#if __has_builtin(__builtin_is_corresponding_member)
3468#define __cpp_lib_is_layout_compatible 201907L
3471 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
3474 {
return __builtin_is_corresponding_member(__m1, __m2); }
3478#if __has_builtin(__is_pointer_interconvertible_base_of)
3481 template<
typename _Base,
typename _Derived>
3483 :
bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
3488 template<
typename _Base,
typename _Derived>
3490 = __is_pointer_interconvertible_base_of(_Base, _Derived);
3492#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
3493#define __cpp_lib_is_pointer_interconvertible 201907L
3498 template<
typename _Tp,
typename _Mem>
3501 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
3505#if __cplusplus > 202002L
3506#define __cpp_lib_is_scoped_enum 202011L
3511 template<
typename _Tp>
3512 struct is_scoped_enum
3516 template<
typename _Tp>
3517 requires __is_enum(_Tp)
3518 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
3519 struct is_scoped_enum<_Tp>
3520 :
bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3525 template<
typename _Tp>
3526 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3528#if __has_builtin(__reference_constructs_from_temporary) \
3529 && __has_builtin(__reference_converts_from_temporary)
3531#define __cpp_lib_reference_from_temporary 202202L
3537 template<
typename _Tp,
typename _Up>
3538 struct reference_constructs_from_temporary
3539 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
3541 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3542 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3543 "template argument must be a complete class or an unbounded array");
3550 template<
typename _Tp,
typename _Up>
3551 struct reference_converts_from_temporary
3552 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
3554 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3555 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3556 "template argument must be a complete class or an unbounded array");
3561 template<
typename _Tp,
typename _Up>
3562 inline constexpr bool reference_constructs_from_temporary_v
3563 = reference_constructs_from_temporary<_Tp, _Up>::value;
3567 template<
typename _Tp,
typename _Up>
3568 inline constexpr bool reference_converts_from_temporary_v
3569 = reference_converts_from_temporary<_Tp, _Up>::value;
3573#if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
3574#define __cpp_lib_is_constant_evaluated 201811L
3578 constexpr inline bool
3581#if __cpp_if_consteval >= 202106L
3582 if consteval {
return true; }
else {
return false; }
3584 return __builtin_is_constant_evaluated();
3590 template<
typename _From,
typename _To>
3591 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3593 template<
typename _Xp,
typename _Yp>
3595 =
decltype(
false ? declval<_Xp(&)()>()() :
declval<_Yp(&)()>()());
3597 template<
typename _Ap,
typename _Bp,
typename =
void>
3598 struct __common_ref_impl
3602 template<
typename _Ap,
typename _Bp>
3603 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3606 template<
typename _Xp,
typename _Yp>
3607 using __condres_cvref
3608 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
3611 template<
typename _Xp,
typename _Yp>
3612 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
3613 : enable_if<is_reference_v<__condres_cvref<_Xp, _Yp>>,
3614 __condres_cvref<_Xp, _Yp>>
3618 template<
typename _Xp,
typename _Yp>
3619 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3622 template<
typename _Xp,
typename _Yp>
3623 struct __common_ref_impl<_Xp&&, _Yp&&,
3624 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3625 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3626 {
using type = __common_ref_C<_Xp, _Yp>; };
3629 template<
typename _Xp,
typename _Yp>
3630 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3633 template<
typename _Xp,
typename _Yp>
3634 struct __common_ref_impl<_Xp&&, _Yp&,
3635 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3636 {
using type = __common_ref_D<_Xp, _Yp>; };
3639 template<
typename _Xp,
typename _Yp>
3640 struct __common_ref_impl<_Xp&, _Yp&&>
3641 : __common_ref_impl<_Yp&&, _Xp&>
3645 template<
typename _Tp,
typename _Up,
3646 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3647 struct basic_common_reference
3651 template<
typename _Tp>
3653 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3655 template<
typename _Tp>
3657 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3659 template<
typename _Tp>
3660 struct __xref<_Tp&&>
3661 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3663 template<
typename _Tp1,
typename _Tp2>
3664 using __basic_common_ref
3665 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3666 remove_cvref_t<_Tp2>,
3667 __xref<_Tp1>::template __type,
3668 __xref<_Tp2>::template __type>::type;
3671 template<
typename... _Tp>
3672 struct common_reference;
3674 template<
typename... _Tp>
3675 using common_reference_t =
typename common_reference<_Tp...>::type;
3679 struct common_reference<>
3683 template<
typename _Tp0>
3684 struct common_reference<_Tp0>
3685 {
using type = _Tp0; };
3688 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3689 struct __common_reference_impl
3690 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3694 template<
typename _Tp1,
typename _Tp2>
3695 struct common_reference<_Tp1, _Tp2>
3696 : __common_reference_impl<_Tp1, _Tp2>
3700 template<
typename _Tp1,
typename _Tp2>
3701 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3702 void_t<__common_ref<_Tp1&, _Tp2&>>>
3703 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3705 template<
typename _Tp1,
typename _Tp2>
3706 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3707 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3708 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3710 template<
typename _Tp1,
typename _Tp2>
3711 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3712 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3713 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3715 template<
typename _Tp1,
typename _Tp2>
3716 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3717 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3718 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3721 template<
typename _Tp1,
typename _Tp2>
3722 struct __common_reference_impl<_Tp1, _Tp2, 2,
3723 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3724 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3727 template<
typename _Tp1,
typename _Tp2>
3728 struct __common_reference_impl<_Tp1, _Tp2, 3,
3729 void_t<__cond_res<_Tp1, _Tp2>>>
3730 {
using type = __cond_res<_Tp1, _Tp2>; };
3733 template<
typename _Tp1,
typename _Tp2>
3734 struct __common_reference_impl<_Tp1, _Tp2, 4,
3736 {
using type = common_type_t<_Tp1, _Tp2>; };
3739 template<
typename _Tp1,
typename _Tp2>
3740 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3744 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3745 struct common_reference<_Tp1, _Tp2, _Rest...>
3746 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3747 __common_type_pack<_Rest...>>
3751 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3752 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3753 __common_type_pack<_Rest...>,
3754 void_t<common_reference_t<_Tp1, _Tp2>>>
3755 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3763_GLIBCXX_END_NAMESPACE_VERSION
typename type_identity< _Tp >::type type_identity_t
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 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.
constexpr bool is_nothrow_swappable_v
is_nothrow_swappable_v
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
integral_constant< bool, __v > bool_constant
Alias template for compile-time boolean constant types.
constexpr bool is_nothrow_convertible_v
is_nothrow_convertible_v
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
void void_t
A metafunction that always yields void, used for detecting valid types.
constexpr bool is_swappable_v
is_swappable_v
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename remove_cv< _Tp >::type remove_cv_t
Alias template for remove_cv.
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 add_const< _Tp >::type add_const_t
Alias template for add_const.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
typename add_cv< _Tp >::type add_cv_t
Alias template for add_cv.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
typename remove_const< _Tp >::type remove_const_t
Alias template for remove_const.
constexpr bool is_swappable_with_v
is_swappable_with_v
typename add_volatile< _Tp >::type add_volatile_t
Alias template for add_volatile.
typename remove_volatile< _Tp >::type remove_volatile_t
Alias template for remove_volatile.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
typename remove_cvref< _Tp >::type remove_cvref_t
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.
constexpr bool is_constant_evaluated() noexcept
Returns true only when called during constant evaluation.
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.
typename invoke_result< _Fn, _Args... >::type invoke_result_t
std::invoke_result_t
constexpr bool is_nothrow_swappable_with_v
is_nothrow_swappable_with_v
constexpr bool is_aggregate_v
constexpr bool is_bounded_array_v
True for a type that is an array of known bound.
constexpr bool is_unbounded_array_v
True for a type that is an array of unknown bound.
constexpr bool is_layout_compatible_v
constexpr bool is_pointer_interconvertible_base_of_v
auto declval() noexcept -> decltype(__declval< _Tp >(0))
void swap(any &__x, any &__y) noexcept
Exchange the states of two any objects.
ISO C++ entities toplevel namespace is std.
Primary class template for reference_wrapper.
Define a member typedef type only if a boolean constant is true.
is_member_function_pointer
is_null_pointer (LWG 2247).
__is_nullptr_t (deprecated extension).
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.
aligned_storage< _S_len, alignment_value >::type type
The storage.
Define a member typedef type to one of two argument types.
The underlying type of an enum.
Metafunctions used for detecting swappable types: p0185r1.
is_nothrow_swappable_with
std::is_nothrow_invocable
std::is_nothrow_invocable_r
has_unique_object_representations
is_aggregate - true if the type is an aggregate.
True for a type that is an array of known bound.
True for a type that is an array of unknown bound.
True if _Derived is standard-layout and has a base class of type _Base