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#ifdef __STDCPP_FLOAT16_T__
464 struct __is_floating_point_helper<_Float16>
468#ifdef __STDCPP_FLOAT32_T__
470 struct __is_floating_point_helper<_Float32>
474#ifdef __STDCPP_FLOAT64_T__
476 struct __is_floating_point_helper<_Float64>
480#ifdef __STDCPP_FLOAT128_T__
482 struct __is_floating_point_helper<_Float128>
486#ifdef __STDCPP_BFLOAT16_T__
488 struct __is_floating_point_helper<
__gnu_cxx::__bfloat16_t>
492#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
494 struct __is_floating_point_helper<__float128>
500 template<
typename _Tp>
502 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
510 template<
typename _Tp, std::
size_t _Size>
514 template<
typename _Tp>
515 struct is_array<_Tp[]>
519 struct __is_pointer_helper
522 template<
typename _Tp>
523 struct __is_pointer_helper<_Tp*>
527 template<
typename _Tp>
529 :
public __is_pointer_helper<__remove_cv_t<_Tp>>::type
537 template<
typename _Tp>
546 template<
typename _Tp>
551 struct __is_member_object_pointer_helper
554 template<
typename _Tp,
typename _Cp>
555 struct __is_member_object_pointer_helper<_Tp _Cp::*>
556 :
public __not_<is_function<_Tp>>::type { };
559 template<
typename _Tp>
561 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
565 struct __is_member_function_pointer_helper
568 template<
typename _Tp,
typename _Cp>
569 struct __is_member_function_pointer_helper<_Tp _Cp::*>
570 :
public is_function<_Tp>::type { };
573 template<
typename _Tp>
575 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
579 template<
typename _Tp>
585 template<
typename _Tp>
591 template<
typename _Tp>
597 template<
typename _Tp>
599 :
public __bool_constant<!is_const<const _Tp>::value> { };
601 template<
typename _Tp>
605 template<
typename _Tp>
606 struct is_function<_Tp&&>
609#define __cpp_lib_is_null_pointer 201309L
612 template<
typename _Tp>
621 struct is_null_pointer<const
std::nullptr_t>
625 struct is_null_pointer<volatile
std::nullptr_t>
629 struct is_null_pointer<const volatile
std::nullptr_t>
634 template<
typename _Tp>
637 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
642 template<
typename _Tp>
647 template<
typename _Tp>
652 template<
typename _Tp>
653 struct is_reference<_Tp&&>
658 template<
typename _Tp>
660 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
664 template<
typename _Tp>
666 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
667 is_null_pointer<_Tp>>::type
671 template<
typename _Tp>
673 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
681 template<
typename _Tp>
683 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
684 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
688 template<
typename _Tp>
690 :
public __not_<is_fundamental<_Tp>>::type { };
693 template<
typename _Tp>
694 struct __is_member_pointer_helper
697 template<
typename _Tp,
typename _Cp>
698 struct __is_member_pointer_helper<_Tp _Cp::*>
703 template<
typename _Tp>
705 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
708 template<
typename,
typename>
712 template<
typename _Tp,
typename... _Types>
713 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
717 template<
typename _Tp>
718 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
719 signed char,
signed short,
signed int,
signed long,
721#if defined(__GLIBCXX_TYPE_INT_N_0)
722 ,
signed __GLIBCXX_TYPE_INT_N_0
724#if defined(__GLIBCXX_TYPE_INT_N_1)
725 ,
signed __GLIBCXX_TYPE_INT_N_1
727#if defined(__GLIBCXX_TYPE_INT_N_2)
728 ,
signed __GLIBCXX_TYPE_INT_N_2
730#if defined(__GLIBCXX_TYPE_INT_N_3)
731 ,
signed __GLIBCXX_TYPE_INT_N_3
737 template<
typename _Tp>
738 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
739 unsigned char,
unsigned short,
unsigned int,
unsigned long,
741#if defined(__GLIBCXX_TYPE_INT_N_0)
742 ,
unsigned __GLIBCXX_TYPE_INT_N_0
744#if defined(__GLIBCXX_TYPE_INT_N_1)
745 ,
unsigned __GLIBCXX_TYPE_INT_N_1
747#if defined(__GLIBCXX_TYPE_INT_N_2)
748 ,
unsigned __GLIBCXX_TYPE_INT_N_2
750#if defined(__GLIBCXX_TYPE_INT_N_3)
751 ,
unsigned __GLIBCXX_TYPE_INT_N_3
756 template<
typename _Tp>
757 using __is_standard_integer
758 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
761 template<
typename...>
using __void_t = void;
771 template<
typename _Tp>
780 template<
typename _Tp>
785 template<
typename _Tp>
789 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
790 "template argument must be a complete class or an unbounded array");
794 template<
typename _Tp>
798 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
799 "template argument must be a complete class or an unbounded array");
803 template<
typename _Tp>
807 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
808 "template argument must be a complete class or an unbounded array");
816 template<
typename _Tp>
818 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
822 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
823 "template argument must be a complete class or an unbounded array");
830 template<
typename _Tp>
832 _GLIBCXX17_DEPRECATED
836 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
837 "template argument must be a complete class or an unbounded array");
841 template<
typename _Tp>
847 template<
typename _Tp>
852#if __cplusplus >= 201402L
853#define __cpp_lib_is_final 201402L
856 template<
typename _Tp>
863 template<
typename _Tp>
869 template<
typename _Tp,
871 struct __is_signed_helper
874 template<
typename _Tp>
875 struct __is_signed_helper<_Tp, true>
876 :
public integral_constant<bool, _Tp(-1) < _Tp(0)>
881 template<typename _Tp>
883 : public __is_signed_helper<_Tp>::type
887 template<typename _Tp>
889 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
893 template<typename _Tp, typename _Up = _Tp&&>
897 template<typename _Tp>
902 template<typename _Tp>
903 auto declval() noexcept -> decltype(__declval<_Tp>(0));
909 template<typename _Tp>
910 struct __is_array_known_bounds
914 template<
typename _Tp,
size_t _Size>
915 struct __is_array_known_bounds<_Tp[_Size]>
919 template<
typename _Tp>
920 struct __is_array_unknown_bounds
924 template<
typename _Tp>
925 struct __is_array_unknown_bounds<_Tp[]>
936 struct __do_is_destructible_impl
938 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
939 static true_type __test(
int);
945 template<
typename _Tp>
946 struct __is_destructible_impl
947 :
public __do_is_destructible_impl
949 typedef decltype(__test<_Tp>(0)) type;
952 template<
typename _Tp,
953 bool = __or_<is_void<_Tp>,
954 __is_array_unknown_bounds<_Tp>,
955 is_function<_Tp>>::value,
956 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
957 struct __is_destructible_safe;
959 template<
typename _Tp>
960 struct __is_destructible_safe<_Tp, false, false>
961 :
public __is_destructible_impl<typename
962 remove_all_extents<_Tp>::type>::type
965 template<
typename _Tp>
966 struct __is_destructible_safe<_Tp, true, false>
969 template<
typename _Tp>
970 struct __is_destructible_safe<_Tp, false, true>
975 template<
typename _Tp>
977 :
public __is_destructible_safe<_Tp>::type
979 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
980 "template argument must be a complete class or an unbounded array");
989 struct __do_is_nt_destructible_impl
991 template<
typename _Tp>
992 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
999 template<
typename _Tp>
1000 struct __is_nt_destructible_impl
1001 :
public __do_is_nt_destructible_impl
1003 typedef decltype(__test<_Tp>(0)) type;
1006 template<
typename _Tp,
1007 bool = __or_<is_void<_Tp>,
1008 __is_array_unknown_bounds<_Tp>,
1009 is_function<_Tp>>::value,
1010 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
1011 struct __is_nt_destructible_safe;
1013 template<
typename _Tp>
1014 struct __is_nt_destructible_safe<_Tp, false, false>
1015 :
public __is_nt_destructible_impl<typename
1016 remove_all_extents<_Tp>::type>::type
1019 template<
typename _Tp>
1020 struct __is_nt_destructible_safe<_Tp, true, false>
1023 template<
typename _Tp>
1024 struct __is_nt_destructible_safe<_Tp, false, true>
1029 template<
typename _Tp>
1031 :
public __is_nt_destructible_safe<_Tp>::type
1033 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1034 "template argument must be a complete class or an unbounded array");
1038 template<
typename _Tp,
typename... _Args>
1039 using __is_constructible_impl
1040 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1044 template<
typename _Tp,
typename... _Args>
1046 :
public __is_constructible_impl<_Tp, _Args...>
1048 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1049 "template argument must be a complete class or an unbounded array");
1053 template<
typename _Tp>
1055 :
public __is_constructible_impl<_Tp>
1057 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1058 "template argument must be a complete class or an unbounded array");
1062 template<
typename _Tp,
typename =
void>
1063 struct __add_lvalue_reference_helper
1064 {
using type = _Tp; };
1066 template<
typename _Tp>
1067 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1068 {
using type = _Tp&; };
1070 template<
typename _Tp>
1071 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1075 template<
typename _Tp>
1077 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1079 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1080 "template argument must be a complete class or an unbounded array");
1084 template<
typename _Tp,
typename =
void>
1085 struct __add_rvalue_reference_helper
1086 {
using type = _Tp; };
1088 template<
typename _Tp>
1089 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1090 {
using type = _Tp&&; };
1092 template<
typename _Tp>
1093 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1097 template<
typename _Tp>
1099 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1101 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1102 "template argument must be a complete class or an unbounded array");
1106 template<
typename _Tp,
typename... _Args>
1107 using __is_nothrow_constructible_impl
1108 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1112 template<
typename _Tp,
typename... _Args>
1114 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1116 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1117 "template argument must be a complete class or an unbounded array");
1121 template<
typename _Tp>
1123 :
public __is_nothrow_constructible_impl<_Tp>
1125 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1126 "template argument must be a complete class or an unbounded array");
1130 template<
typename _Tp>
1132 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1134 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1135 "template argument must be a complete class or an unbounded array");
1139 template<
typename _Tp>
1141 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1143 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1144 "template argument must be a complete class or an unbounded array");
1148 template<
typename _Tp,
typename _Up>
1149 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1153 template<
typename _Tp,
typename _Up>
1155 :
public __is_assignable_impl<_Tp, _Up>
1157 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1158 "template argument must be a complete class or an unbounded array");
1162 template<
typename _Tp>
1164 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1165 __add_lval_ref_t<const _Tp>>
1167 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1168 "template argument must be a complete class or an unbounded array");
1172 template<
typename _Tp>
1174 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1176 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1177 "template argument must be a complete class or an unbounded array");
1181 template<
typename _Tp,
typename _Up>
1182 using __is_nothrow_assignable_impl
1183 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1187 template<
typename _Tp,
typename _Up>
1189 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1191 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1192 "template argument must be a complete class or an unbounded array");
1196 template<
typename _Tp>
1198 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1199 __add_lval_ref_t<const _Tp>>
1201 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1202 "template argument must be a complete class or an unbounded array");
1206 template<
typename _Tp>
1208 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1209 __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_trivially_constructible_impl
1218 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1222 template<
typename _Tp,
typename... _Args>
1224 :
public __is_trivially_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_trivially_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");
1239 struct __do_is_implicitly_default_constructible_impl
1241 template <
typename _Tp>
1242 static void __helper(
const _Tp&);
1244 template <
typename _Tp>
1246 decltype(__helper<const _Tp&>({}))* = 0);
1251 template<
typename _Tp>
1252 struct __is_implicitly_default_constructible_impl
1253 :
public __do_is_implicitly_default_constructible_impl
1255 typedef decltype(__test(declval<_Tp>())) type;
1258 template<
typename _Tp>
1259 struct __is_implicitly_default_constructible_safe
1260 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1263 template <
typename _Tp>
1264 struct __is_implicitly_default_constructible
1265 :
public __and_<__is_constructible_impl<_Tp>,
1266 __is_implicitly_default_constructible_safe<_Tp>>::type
1270 template<
typename _Tp>
1272 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1274 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1275 "template argument must be a complete class or an unbounded array");
1279 template<
typename _Tp>
1281 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1283 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1284 "template argument must be a complete class or an unbounded array");
1288 template<
typename _Tp,
typename _Up>
1289 using __is_trivially_assignable_impl
1290 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1294 template<
typename _Tp,
typename _Up>
1296 :
public __is_trivially_assignable_impl<_Tp, _Up>
1298 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1299 "template argument must be a complete class or an unbounded array");
1303 template<
typename _Tp>
1305 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1306 __add_lval_ref_t<const _Tp>>
1308 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1309 "template argument must be a complete class or an unbounded array");
1313 template<
typename _Tp>
1315 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1316 __add_rval_ref_t<_Tp>>
1318 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1319 "template argument must be a complete class or an unbounded array");
1323 template<
typename _Tp>
1325 :
public __and_<__is_destructible_safe<_Tp>,
1326 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1328 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1329 "template argument must be a complete class or an unbounded array");
1334 template<
typename _Tp>
1338 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1339 "template argument must be a complete class or an unbounded array");
1346 template<
typename _Tp>
1350 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1351 "template argument must be a complete class or an unbounded array");
1359 template<
typename _Tp, std::
size_t _Size>
1360 struct rank<_Tp[_Size]>
1363 template<
typename _Tp>
1365 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1368 template<
typename,
unsigned _U
int = 0>
1372 template<
typename _Tp,
size_t _Size>
1373 struct extent<_Tp[_Size], 0>
1376 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1377 struct extent<_Tp[_Size], _Uint>
1378 :
public extent<_Tp, _Uint - 1>::type { };
1380 template<
typename _Tp>
1381 struct extent<_Tp[], 0>
1382 :
public integral_constant<size_t, 0> { };
1384 template<
typename _Tp,
unsigned _U
int>
1385 struct extent<_Tp[], _Uint>
1386 :
public extent<_Tp, _Uint - 1>::type { };
1392 template<
typename _Tp,
typename _Up>
1394#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1401#ifndef _GLIBCXX_HAVE_BUILTIN_IS_SAME
1402 template<
typename _Tp>
1409 template<
typename _Base,
typename _Derived>
1414#if __has_builtin(__is_convertible)
1415 template<
typename _From,
typename _To>
1416 struct is_convertible
1417 :
public __bool_constant<__is_convertible(_From, _To)>
1420 template<
typename _From,
typename _To,
1421 bool = __or_<is_void<_From>, is_function<_To>,
1422 is_array<_To>>::value>
1423 struct __is_convertible_helper
1425 typedef typename is_void<_To>::type type;
1428#pragma GCC diagnostic push
1429#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1430 template<
typename _From,
typename _To>
1431 class __is_convertible_helper<_From, _To, false>
1433 template<
typename _To1>
1434 static void __test_aux(_To1)
noexcept;
1436 template<
typename _From1,
typename _To1,
1437 typename =
decltype(__test_aux<_To1>(std::declval<_From1>()))>
1441 template<
typename,
typename>
1446 typedef decltype(__test<_From, _To>(0)) type;
1448#pragma GCC diagnostic pop
1451 template<
typename _From,
typename _To>
1452 struct is_convertible
1453 :
public __is_convertible_helper<_From, _To>::type
1458 template<
typename _ToElementType,
typename _FromElementType>
1459 using __is_array_convertible
1460 = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>;
1462#if __cplusplus >= 202002L
1463#define __cpp_lib_is_nothrow_convertible 201806L
1465#if __has_builtin(__is_nothrow_convertible)
1467 template<
typename _From,
typename _To>
1469 = __is_nothrow_convertible(_From, _To);
1472 template<
typename _From,
typename _To>
1474 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1477 template<
typename _From,
typename _To,
1480 struct __is_nt_convertible_helper
1484#pragma GCC diagnostic push
1485#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1486 template<
typename _From,
typename _To>
1487 class __is_nt_convertible_helper<_From, _To, false>
1489 template<
typename _To1>
1490 static void __test_aux(_To1)
noexcept;
1492 template<
typename _From1,
typename _To1>
1494 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1497 template<
typename,
typename>
1502 using type =
decltype(__test<_From, _To>(0));
1504#pragma GCC diagnostic pop
1507 template<
typename _From,
typename _To>
1508 struct is_nothrow_convertible
1509 :
public __is_nt_convertible_helper<_From, _To>::type
1513 template<
typename _From,
typename _To>
1515 = is_nothrow_convertible<_From, _To>::value;
1522 template<
typename _Tp>
1524 {
typedef _Tp type; };
1526 template<
typename _Tp>
1528 {
typedef _Tp type; };
1531 template<
typename _Tp>
1533 {
typedef _Tp type; };
1535 template<
typename _Tp>
1537 {
typedef _Tp type; };
1540#if __has_builtin(__remove_cv)
1541 template<
typename _Tp>
1543 {
using type = __remove_cv(_Tp); };
1545 template<
typename _Tp>
1547 {
using type = _Tp; };
1549 template<
typename _Tp>
1550 struct remove_cv<const _Tp>
1551 {
using type = _Tp; };
1553 template<
typename _Tp>
1554 struct remove_cv<volatile _Tp>
1555 {
using type = _Tp; };
1557 template<
typename _Tp>
1558 struct remove_cv<const volatile _Tp>
1559 {
using type = _Tp; };
1563 template<
typename _Tp>
1565 {
using type = _Tp
const; };
1568 template<
typename _Tp>
1570 {
using type = _Tp
volatile; };
1573 template<
typename _Tp>
1575 {
using type = _Tp
const volatile; };
1577#if __cplusplus > 201103L
1579#define __cpp_lib_transformation_trait_aliases 201304L
1582 template<
typename _Tp>
1586 template<
typename _Tp>
1590 template<
typename _Tp>
1594 template<
typename _Tp>
1598 template<
typename _Tp>
1602 template<
typename _Tp>
1609#if __has_builtin(__remove_reference)
1610 template<
typename _Tp>
1612 {
using type = __remove_reference(_Tp); };
1614 template<
typename _Tp>
1616 {
using type = _Tp; };
1618 template<
typename _Tp>
1619 struct remove_reference<_Tp&>
1620 {
using type = _Tp; };
1622 template<
typename _Tp>
1623 struct remove_reference<_Tp&&>
1624 {
using type = _Tp; };
1628 template<
typename _Tp>
1630 {
using type = __add_lval_ref_t<_Tp>; };
1633 template<
typename _Tp>
1635 {
using type = __add_rval_ref_t<_Tp>; };
1637#if __cplusplus > 201103L
1639 template<
typename _Tp>
1643 template<
typename _Tp>
1647 template<
typename _Tp>
1656 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1657 struct __cv_selector;
1659 template<
typename _Unqualified>
1660 struct __cv_selector<_Unqualified, false, false>
1661 {
typedef _Unqualified __type; };
1663 template<
typename _Unqualified>
1664 struct __cv_selector<_Unqualified, false, true>
1665 {
typedef volatile _Unqualified __type; };
1667 template<
typename _Unqualified>
1668 struct __cv_selector<_Unqualified, true, false>
1669 {
typedef const _Unqualified __type; };
1671 template<
typename _Unqualified>
1672 struct __cv_selector<_Unqualified, true, true>
1673 {
typedef const volatile _Unqualified __type; };
1675 template<
typename _Qualified,
typename _Unqualified,
1676 bool _IsConst = is_const<_Qualified>::value,
1677 bool _IsVol = is_volatile<_Qualified>::value>
1678 class __match_cv_qualifiers
1680 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1683 typedef typename __match::__type __type;
1687 template<
typename _Tp>
1688 struct __make_unsigned
1689 {
typedef _Tp __type; };
1692 struct __make_unsigned<char>
1693 {
typedef unsigned char __type; };
1696 struct __make_unsigned<signed char>
1697 {
typedef unsigned char __type; };
1700 struct __make_unsigned<short>
1701 {
typedef unsigned short __type; };
1704 struct __make_unsigned<int>
1705 {
typedef unsigned int __type; };
1708 struct __make_unsigned<long>
1709 {
typedef unsigned long __type; };
1712 struct __make_unsigned<long long>
1713 {
typedef unsigned long long __type; };
1715#if defined(__GLIBCXX_TYPE_INT_N_0)
1718 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1719 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1721#if defined(__GLIBCXX_TYPE_INT_N_1)
1724 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1725 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1727#if defined(__GLIBCXX_TYPE_INT_N_2)
1730 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1731 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1733#if defined(__GLIBCXX_TYPE_INT_N_3)
1736 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1737 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1741 template<
typename _Tp,
1742 bool _IsInt = is_integral<_Tp>::value,
1743 bool _IsEnum = is_enum<_Tp>::value>
1744 class __make_unsigned_selector;
1746 template<
typename _Tp>
1747 class __make_unsigned_selector<_Tp, true, false>
1749 using __unsigned_type
1750 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1754 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1757 class __make_unsigned_selector_base
1760 template<
typename...>
struct _List { };
1762 template<
typename _Tp,
typename... _Up>
1763 struct _List<_Tp, _Up...> : _List<_Up...>
1764 {
static constexpr size_t __size =
sizeof(_Tp); };
1766 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1769 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1770 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1771 {
using __type = _Uint; };
1773 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1774 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1775 : __select<_Sz, _List<_UInts...>>
1780 template<
typename _Tp>
1781 class __make_unsigned_selector<_Tp, false, true>
1782 : __make_unsigned_selector_base
1785 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1786 unsigned long,
unsigned long long>;
1788 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1792 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1800 struct __make_unsigned<wchar_t>
1803 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1806#ifdef _GLIBCXX_USE_CHAR8_T
1808 struct __make_unsigned<char8_t>
1811 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1816 struct __make_unsigned<char16_t>
1819 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1823 struct __make_unsigned<char32_t>
1826 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1834 template<
typename _Tp>
1836 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1847 template<
typename _Tp>
1848 struct __make_signed
1849 {
typedef _Tp __type; };
1852 struct __make_signed<char>
1853 {
typedef signed char __type; };
1856 struct __make_signed<unsigned char>
1857 {
typedef signed char __type; };
1860 struct __make_signed<unsigned short>
1861 {
typedef signed short __type; };
1864 struct __make_signed<unsigned int>
1865 {
typedef signed int __type; };
1868 struct __make_signed<unsigned long>
1869 {
typedef signed long __type; };
1872 struct __make_signed<unsigned long long>
1873 {
typedef signed long long __type; };
1875#if defined(__GLIBCXX_TYPE_INT_N_0)
1878 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1879 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1881#if defined(__GLIBCXX_TYPE_INT_N_1)
1884 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1885 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1887#if defined(__GLIBCXX_TYPE_INT_N_2)
1890 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1891 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1893#if defined(__GLIBCXX_TYPE_INT_N_3)
1896 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1897 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1901 template<
typename _Tp,
1902 bool _IsInt = is_integral<_Tp>::value,
1903 bool _IsEnum = is_enum<_Tp>::value>
1904 class __make_signed_selector;
1906 template<
typename _Tp>
1907 class __make_signed_selector<_Tp, true, false>
1910 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
1914 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
1918 template<
typename _Tp>
1919 class __make_signed_selector<_Tp, false, true>
1921 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1924 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1932 struct __make_signed<wchar_t>
1935 =
typename __make_signed_selector<wchar_t, false, true>::__type;
1938#if defined(_GLIBCXX_USE_CHAR8_T)
1940 struct __make_signed<char8_t>
1943 =
typename __make_signed_selector<char8_t, false, true>::__type;
1948 struct __make_signed<char16_t>
1951 =
typename __make_signed_selector<char16_t, false, true>::__type;
1955 struct __make_signed<char32_t>
1958 =
typename __make_signed_selector<char32_t, false, true>::__type;
1966 template<
typename _Tp>
1968 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1974 template<>
struct make_signed<bool const volatile>;
1976#if __cplusplus > 201103L
1978 template<
typename _Tp>
1982 template<
typename _Tp>
1989 template<
typename _Tp>
1991 {
typedef _Tp type; };
1993 template<
typename _Tp, std::
size_t _Size>
1995 {
typedef _Tp type; };
1997 template<
typename _Tp>
1998 struct remove_extent<_Tp[]>
1999 {
typedef _Tp type; };
2002 template<
typename _Tp>
2004 {
typedef _Tp type; };
2006 template<
typename _Tp, std::
size_t _Size>
2008 {
typedef typename remove_all_extents<_Tp>::type type; };
2010 template<
typename _Tp>
2011 struct remove_all_extents<_Tp[]>
2012 {
typedef typename remove_all_extents<_Tp>::type type; };
2014#if __cplusplus > 201103L
2016 template<
typename _Tp>
2020 template<
typename _Tp>
2026 template<
typename _Tp,
typename>
2027 struct __remove_pointer_helper
2028 {
typedef _Tp type; };
2030 template<
typename _Tp,
typename _Up>
2031 struct __remove_pointer_helper<_Tp, _Up*>
2032 {
typedef _Up type; };
2035 template<
typename _Tp>
2037 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2040 template<
typename _Tp,
typename =
void>
2041 struct __add_pointer_helper
2042 {
using type = _Tp; };
2044 template<
typename _Tp>
2045 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2046 {
using type = _Tp*; };
2049 template<
typename _Tp>
2051 :
public __add_pointer_helper<_Tp>
2054 template<
typename _Tp>
2056 {
using type = _Tp*; };
2058 template<
typename _Tp>
2059 struct add_pointer<_Tp&&>
2060 {
using type = _Tp*; };
2062#if __cplusplus > 201103L
2064 template<
typename _Tp>
2068 template<
typename _Tp>
2072 template<std::
size_t _Len>
2073 struct __aligned_storage_msa
2077 unsigned char __data[_Len];
2078 struct __attribute__((__aligned__)) { } __align;
2095 template<std::size_t _Len, std::size_t _Align =
2096 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2098 _GLIBCXX23_DEPRECATED
2103 unsigned char __data[_Len];
2104 struct __attribute__((__aligned__((_Align)))) { } __align;
2108 template <
typename... _Types>
2109 struct __strictest_alignment
2111 static const size_t _S_alignment = 0;
2112 static const size_t _S_size = 0;
2115 template <
typename _Tp,
typename... _Types>
2116 struct __strictest_alignment<_Tp, _Types...>
2118 static const size_t _S_alignment =
2119 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2120 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2121 static const size_t _S_size =
2122 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2123 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2126#pragma GCC diagnostic push
2127#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2141 template <
size_t _Len,
typename... _Types>
2143 _GLIBCXX23_DEPRECATED
2147 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2149 using __strictest = __strictest_alignment<_Types...>;
2150 static const size_t _S_len = _Len > __strictest::_S_size
2151 ? _Len : __strictest::_S_size;
2154 static const size_t alignment_value = __strictest::_S_alignment;
2159 template <
size_t _Len,
typename... _Types>
2160 const size_t aligned_union<_Len, _Types...>::alignment_value;
2161#pragma GCC diagnostic pop
2167 template<
typename _Up>
2168 struct __decay_selector
2169 : __conditional_t<is_const<const _Up>::value,
2174 template<
typename _Up,
size_t _Nm>
2175 struct __decay_selector<_Up[_Nm]>
2176 {
using type = _Up*; };
2178 template<
typename _Up>
2179 struct __decay_selector<_Up[]>
2180 {
using type = _Up*; };
2185 template<
typename _Tp>
2187 {
using type =
typename __decay_selector<_Tp>::type; };
2189 template<
typename _Tp>
2191 {
using type =
typename __decay_selector<_Tp>::type; };
2193 template<
typename _Tp>
2195 {
using type =
typename __decay_selector<_Tp>::type; };
2200 template<
typename _Tp>
2201 struct __strip_reference_wrapper
2206 template<
typename _Tp>
2207 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2209 typedef _Tp& __type;
2213 template<
typename _Tp>
2214 using __decay_t =
typename decay<_Tp>::type;
2216 template<
typename _Tp>
2217 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2223 template<
typename... _Cond>
2224 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2227 template<
typename _Tp>
2228 using __remove_cvref_t
2229 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2234 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2236 {
typedef _Iftrue type; };
2239 template<
typename _Iftrue,
typename _Iffalse>
2241 {
typedef _Iffalse type; };
2244 template<
typename... _Tp>
2256 template<
typename _Tp>
2257 struct __success_type
2258 {
typedef _Tp type; };
2260 struct __failure_type
2263 struct __do_common_type_impl
2265 template<
typename _Tp,
typename _Up>
2267 =
decltype(
true ? std::declval<_Tp>() :
std::declval<_Up>());
2271 template<
typename _Tp,
typename _Up>
2272 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2275#if __cplusplus > 201703L
2278 template<
typename _Tp,
typename _Up>
2279 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2283 template<
typename,
typename>
2284 static __failure_type
2287 template<
typename _Tp,
typename _Up>
2288 static decltype(_S_test_2<_Tp, _Up>(0))
2294 struct common_type<>
2298 template<
typename _Tp0>
2299 struct common_type<_Tp0>
2300 :
public common_type<_Tp0, _Tp0>
2304 template<
typename _Tp1,
typename _Tp2,
2305 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2306 struct __common_type_impl
2310 using type = common_type<_Dp1, _Dp2>;
2313 template<
typename _Tp1,
typename _Tp2>
2314 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2315 :
private __do_common_type_impl
2319 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2323 template<
typename _Tp1,
typename _Tp2>
2324 struct common_type<_Tp1, _Tp2>
2325 :
public __common_type_impl<_Tp1, _Tp2>::type
2328 template<
typename...>
2329 struct __common_type_pack
2332 template<
typename,
typename,
typename =
void>
2333 struct __common_type_fold;
2336 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2337 struct common_type<_Tp1, _Tp2, _Rp...>
2338 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2339 __common_type_pack<_Rp...>>
2345 template<
typename _CTp,
typename... _Rp>
2346 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2347 __void_t<typename _CTp::type>>
2348 :
public common_type<typename _CTp::type, _Rp...>
2352 template<
typename _CTp,
typename _Rp>
2353 struct __common_type_fold<_CTp, _Rp, void>
2356 template<typename _Tp, bool = is_enum<_Tp>::value>
2357 struct __underlying_type_impl
2359 using type = __underlying_type(_Tp);
2362 template<
typename _Tp>
2363 struct __underlying_type_impl<_Tp, false>
2368 template<
typename _Tp>
2370 :
public __underlying_type_impl<_Tp>
2374 template<
typename _Tp>
2375 struct __declval_protector
2377 static const bool __stop =
false;
2385 template<
typename _Tp>
2386 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2388 static_assert(__declval_protector<_Tp>::__stop,
2389 "declval() must not be used!");
2390 return __declval<_Tp>(0);
2394 template<
typename _Signature>
2399#define __cpp_lib_result_of_sfinae 201210L
2402 struct __invoke_memfun_ref { };
2403 struct __invoke_memfun_deref { };
2404 struct __invoke_memobj_ref { };
2405 struct __invoke_memobj_deref { };
2406 struct __invoke_other { };
2409 template<
typename _Tp,
typename _Tag>
2410 struct __result_of_success : __success_type<_Tp>
2411 {
using __invoke_type = _Tag; };
2414 struct __result_of_memfun_ref_impl
2416 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2417 static __result_of_success<
decltype(
2418 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2419 ), __invoke_memfun_ref> _S_test(
int);
2421 template<
typename...>
2422 static __failure_type _S_test(...);
2425 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2426 struct __result_of_memfun_ref
2427 :
private __result_of_memfun_ref_impl
2429 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2433 struct __result_of_memfun_deref_impl
2435 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2436 static __result_of_success<
decltype(
2437 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2438 ), __invoke_memfun_deref> _S_test(
int);
2440 template<
typename...>
2441 static __failure_type _S_test(...);
2444 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2445 struct __result_of_memfun_deref
2446 :
private __result_of_memfun_deref_impl
2448 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2452 struct __result_of_memobj_ref_impl
2454 template<
typename _Fp,
typename _Tp1>
2455 static __result_of_success<
decltype(
2456 std::declval<_Tp1>().*std::declval<_Fp>()
2457 ), __invoke_memobj_ref> _S_test(
int);
2459 template<
typename,
typename>
2460 static __failure_type _S_test(...);
2463 template<
typename _MemPtr,
typename _Arg>
2464 struct __result_of_memobj_ref
2465 :
private __result_of_memobj_ref_impl
2467 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2471 struct __result_of_memobj_deref_impl
2473 template<
typename _Fp,
typename _Tp1>
2474 static __result_of_success<
decltype(
2475 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2476 ), __invoke_memobj_deref> _S_test(
int);
2478 template<
typename,
typename>
2479 static __failure_type _S_test(...);
2482 template<
typename _MemPtr,
typename _Arg>
2483 struct __result_of_memobj_deref
2484 :
private __result_of_memobj_deref_impl
2486 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2489 template<
typename _MemPtr,
typename _Arg>
2490 struct __result_of_memobj;
2492 template<
typename _Res,
typename _Class,
typename _Arg>
2493 struct __result_of_memobj<_Res _Class::*, _Arg>
2495 typedef __remove_cvref_t<_Arg> _Argval;
2496 typedef _Res _Class::* _MemPtr;
2497 typedef typename __conditional_t<__or_<is_same<_Argval, _Class>,
2498 is_base_of<_Class, _Argval>>::value,
2499 __result_of_memobj_ref<_MemPtr, _Arg>,
2500 __result_of_memobj_deref<_MemPtr, _Arg>
2504 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2505 struct __result_of_memfun;
2507 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2508 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2510 typedef typename remove_reference<_Arg>::type _Argval;
2511 typedef _Res _Class::* _MemPtr;
2512 typedef typename __conditional_t<is_base_of<_Class, _Argval>::value,
2513 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2514 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2523 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2529 template<
typename _Tp,
typename _Up>
2530 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2535 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2536 struct __result_of_impl
2538 typedef __failure_type type;
2541 template<
typename _MemPtr,
typename _Arg>
2542 struct __result_of_impl<true, false, _MemPtr, _Arg>
2543 :
public __result_of_memobj<__decay_t<_MemPtr>,
2544 typename __inv_unwrap<_Arg>::type>
2547 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2548 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2549 :
public __result_of_memfun<__decay_t<_MemPtr>,
2550 typename __inv_unwrap<_Arg>::type, _Args...>
2554 struct __result_of_other_impl
2556 template<
typename _Fn,
typename... _Args>
2557 static __result_of_success<
decltype(
2558 std::declval<_Fn>()(std::declval<_Args>()...)
2559 ), __invoke_other> _S_test(
int);
2561 template<
typename...>
2562 static __failure_type _S_test(...);
2565 template<
typename _Functor,
typename... _ArgTypes>
2566 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2567 :
private __result_of_other_impl
2569 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2573 template<typename _Functor, typename... _ArgTypes>
2574 struct __invoke_result
2575 : public __result_of_impl<
2576 is_member_object_pointer<
2577 typename remove_reference<_Functor>::type
2579 is_member_function_pointer<
2580 typename remove_reference<_Functor>::type
2582 _Functor, _ArgTypes...
2587 template<
typename _Functor,
typename... _ArgTypes>
2588 struct result_of<_Functor(_ArgTypes...)>
2589 :
public __invoke_result<_Functor, _ArgTypes...>
2590 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2592#if __cplusplus >= 201402L
2593#pragma GCC diagnostic push
2594#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2596 template<
size_t _Len,
size_t _Align =
2597 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2600 template <
size_t _Len,
typename... _Types>
2601 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2602#pragma GCC diagnostic pop
2605 template<
typename _Tp>
2609 template<
bool _Cond,
typename _Tp =
void>
2613 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2617 template<
typename... _Tp>
2621 template<
typename _Tp>
2625 template<
typename _Tp>
2629#if __cplusplus >= 201703L || !defined(__STRICT_ANSI__)
2630#define __cpp_lib_void_t 201411L
2642 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2643 struct __detected_or
2650 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2651 requires requires {
typename _Op<_Args...>; }
2652 struct __detected_or<_Def, _Op, _Args...>
2654 using type = _Op<_Args...>;
2659 template<
typename _Default,
typename _AlwaysVoid,
2660 template<
typename...>
class _Op,
typename... _Args>
2663 using type = _Default;
2668 template<
typename _Default,
template<
typename...>
class _Op,
2670 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2672 using type = _Op<_Args...>;
2676 template<
typename _Default,
template<
typename...>
class _Op,
2678 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2682 template<
typename _Default,
template<
typename...>
class _Op,
2684 using __detected_or_t
2685 =
typename __detected_or<_Default, _Op, _Args...>::type;
2691#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2692 template<typename _Tp, typename = __void_t<>> \
2693 struct __has_##_NTYPE \
2696 template<typename _Tp> \
2697 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2701 template <
typename _Tp>
2702 struct __is_swappable;
2704 template <
typename _Tp>
2705 struct __is_nothrow_swappable;
2712 template<
typename _Tp>
2713 struct __is_tuple_like
2714 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2718 template<
typename _Tp>
2719 _GLIBCXX20_CONSTEXPR
2721 _Require<__not_<__is_tuple_like<_Tp>>,
2722 is_move_constructible<_Tp>,
2723 is_move_assignable<_Tp>>
2725 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2726 is_nothrow_move_assignable<_Tp>>::value);
2728 template<
typename _Tp,
size_t _Nm>
2729 _GLIBCXX20_CONSTEXPR
2731 __enable_if_t<__is_swappable<_Tp>::value>
2732 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2733 noexcept(__is_nothrow_swappable<_Tp>::value);
2736 namespace __swappable_details {
2739 struct __do_is_swappable_impl
2741 template<
typename _Tp,
typename
2742 =
decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2743 static true_type __test(
int);
2749 struct __do_is_nothrow_swappable_impl
2751 template<
typename _Tp>
2752 static __bool_constant<
2753 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2762 template<
typename _Tp>
2763 struct __is_swappable_impl
2764 :
public __swappable_details::__do_is_swappable_impl
2766 typedef decltype(__test<_Tp>(0)) type;
2769 template<
typename _Tp>
2770 struct __is_nothrow_swappable_impl
2771 :
public __swappable_details::__do_is_nothrow_swappable_impl
2773 typedef decltype(__test<_Tp>(0)) type;
2776 template<
typename _Tp>
2777 struct __is_swappable
2778 :
public __is_swappable_impl<_Tp>::type
2781 template<
typename _Tp>
2782 struct __is_nothrow_swappable
2783 :
public __is_nothrow_swappable_impl<_Tp>::type
2787#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
2788#define __cpp_lib_is_swappable 201603L
2792 template<
typename _Tp>
2794 :
public __is_swappable_impl<_Tp>::type
2796 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2797 "template argument must be a complete class or an unbounded array");
2801 template<
typename _Tp>
2803 :
public __is_nothrow_swappable_impl<_Tp>::type
2805 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2806 "template argument must be a complete class or an unbounded array");
2809#if __cplusplus >= 201402L
2811 template<
typename _Tp>
2816 template<
typename _Tp>
2822 namespace __swappable_with_details {
2825 struct __do_is_swappable_with_impl
2827 template<
typename _Tp,
typename _Up,
typename
2828 =
decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2830 =
decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2833 template<
typename,
typename>
2837 struct __do_is_nothrow_swappable_with_impl
2839 template<
typename _Tp,
typename _Up>
2840 static __bool_constant<
2841 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2843 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2846 template<
typename,
typename>
2852 template<
typename _Tp,
typename _Up>
2853 struct __is_swappable_with_impl
2854 :
public __swappable_with_details::__do_is_swappable_with_impl
2856 typedef decltype(__test<_Tp, _Up>(0)) type;
2860 template<
typename _Tp>
2861 struct __is_swappable_with_impl<_Tp&, _Tp&>
2862 :
public __swappable_details::__do_is_swappable_impl
2864 typedef decltype(__test<_Tp&>(0)) type;
2867 template<
typename _Tp,
typename _Up>
2868 struct __is_nothrow_swappable_with_impl
2869 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2871 typedef decltype(__test<_Tp, _Up>(0)) type;
2875 template<
typename _Tp>
2876 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2877 :
public __swappable_details::__do_is_nothrow_swappable_impl
2879 typedef decltype(__test<_Tp&>(0)) type;
2884 template<
typename _Tp,
typename _Up>
2886 :
public __is_swappable_with_impl<_Tp, _Up>::type
2888 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2889 "first template argument must be a complete class or an unbounded array");
2890 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2891 "second template argument must be a complete class or an unbounded array");
2895 template<
typename _Tp,
typename _Up>
2897 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2899 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2900 "first template argument must be a complete class or an unbounded array");
2901 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2902 "second template argument must be a complete class or an unbounded array");
2905#if __cplusplus >= 201402L
2907 template<
typename _Tp,
typename _Up>
2912 template<
typename _Tp,
typename _Up>
2924 template<
typename _Result,
typename _Ret,
2926 struct __is_invocable_impl
2933 template<
typename _Result,
typename _Ret>
2934 struct __is_invocable_impl<_Result, _Ret,
2936 __void_t<typename _Result::type>>
2939 using __nothrow_conv = true_type;
2942#pragma GCC diagnostic push
2943#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
2945 template<
typename _Result,
typename _Ret>
2946 struct __is_invocable_impl<_Result, _Ret,
2948 __void_t<typename _Result::type>>
2952 using _Res_t =
typename _Result::type;
2956 static _Res_t _S_get() noexcept;
2959 template<typename _Tp>
2960 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
2963 template<typename _Tp,
2964 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
2965 typename = decltype(_S_conv<_Tp>(_S_get())),
2966#if __has_builtin(__reference_converts_from_temporary)
2967 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
2969 bool _Dangle =
false
2972 static __bool_constant<_Nothrow && !_Dangle>
2975 template<
typename _Tp,
bool = false>
2981 using type =
decltype(_S_test<_Ret,
true>(1));
2984 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
2986#pragma GCC diagnostic pop
2988 template<
typename _Fn,
typename... _ArgTypes>
2989 struct __is_invocable
2990 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2993 template<
typename _Fn,
typename _Tp,
typename... _Args>
2994 constexpr bool __call_is_nt(__invoke_memfun_ref)
2996 using _Up =
typename __inv_unwrap<_Tp>::type;
2997 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2998 std::declval<_Args>()...));
3001 template<
typename _Fn,
typename _Tp,
typename... _Args>
3002 constexpr bool __call_is_nt(__invoke_memfun_deref)
3004 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
3005 std::declval<_Args>()...));
3008 template<
typename _Fn,
typename _Tp>
3009 constexpr bool __call_is_nt(__invoke_memobj_ref)
3011 using _Up =
typename __inv_unwrap<_Tp>::type;
3012 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
3015 template<
typename _Fn,
typename _Tp>
3016 constexpr bool __call_is_nt(__invoke_memobj_deref)
3018 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
3021 template<
typename _Fn,
typename... _Args>
3022 constexpr bool __call_is_nt(__invoke_other)
3024 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
3027 template<
typename _Result,
typename _Fn,
typename... _Args>
3028 struct __call_is_nothrow
3030 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3034 template<
typename _Fn,
typename... _Args>
3035 using __call_is_nothrow_
3036 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3039 template<
typename _Fn,
typename... _Args>
3040 struct __is_nothrow_invocable
3041 : __and_<__is_invocable<_Fn, _Args...>,
3042 __call_is_nothrow_<_Fn, _Args...>>::type
3045#pragma GCC diagnostic push
3046#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3047 struct __nonesuchbase {};
3048 struct __nonesuch :
private __nonesuchbase {
3049 ~__nonesuch() =
delete;
3050 __nonesuch(__nonesuch
const&) =
delete;
3051 void operator=(__nonesuch
const&) =
delete;
3053#pragma GCC diagnostic pop
3056#if __cplusplus >= 201703L
3057# define __cpp_lib_is_invocable 201703L
3060 template<
typename _Functor,
typename... _ArgTypes>
3062 :
public __invoke_result<_Functor, _ArgTypes...>
3064 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3065 "_Functor must be a complete class or an unbounded array");
3066 static_assert((std::__is_complete_or_unbounded(
3067 __type_identity<_ArgTypes>{}) && ...),
3068 "each argument type must be a complete class or an unbounded array");
3072 template<
typename _Fn,
typename... _Args>
3076 template<
typename _Fn,
typename... _ArgTypes>
3078 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3080 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3081 "_Fn must be a complete class or an unbounded array");
3082 static_assert((std::__is_complete_or_unbounded(
3083 __type_identity<_ArgTypes>{}) && ...),
3084 "each argument type must be a complete class or an unbounded array");
3088 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3090 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3092 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3093 "_Fn must be a complete class or an unbounded array");
3094 static_assert((std::__is_complete_or_unbounded(
3095 __type_identity<_ArgTypes>{}) && ...),
3096 "each argument type must be a complete class or an unbounded array");
3097 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3098 "_Ret must be a complete class or an unbounded array");
3102 template<
typename _Fn,
typename... _ArgTypes>
3104 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3105 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3107 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3108 "_Fn must be a complete class or an unbounded array");
3109 static_assert((std::__is_complete_or_unbounded(
3110 __type_identity<_ArgTypes>{}) && ...),
3111 "each argument type must be a complete class or an unbounded array");
3118 template<
typename _Result,
typename _Ret>
3119 using __is_nt_invocable_impl
3120 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3124 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3126 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3127 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3129 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3130 "_Fn must be a complete class or an unbounded array");
3131 static_assert((std::__is_complete_or_unbounded(
3132 __type_identity<_ArgTypes>{}) && ...),
3133 "each argument type must be a complete class or an unbounded array");
3134 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3135 "_Ret must be a complete class or an unbounded array");
3139#if __cplusplus >= 201703L
3140# define __cpp_lib_type_trait_variable_templates 201510L
3155template <
typename _Tp>
3157template <
typename _Tp>
3159template <
typename _Tp>
3161template <
typename _Tp>
3164template <
typename _Tp>
3165 inline constexpr bool is_array_v =
false;
3166template <
typename _Tp>
3167 inline constexpr bool is_array_v<_Tp[]> =
true;
3168template <
typename _Tp,
size_t _Num>
3169 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3171template <
typename _Tp>
3173template <
typename _Tp>
3174 inline constexpr bool is_lvalue_reference_v =
false;
3175template <
typename _Tp>
3176 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3177template <
typename _Tp>
3178 inline constexpr bool is_rvalue_reference_v =
false;
3179template <
typename _Tp>
3180 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3181template <
typename _Tp>
3182 inline constexpr bool is_member_object_pointer_v =
3184template <
typename _Tp>
3185 inline constexpr bool is_member_function_pointer_v =
3187template <
typename _Tp>
3188 inline constexpr bool is_enum_v = __is_enum(_Tp);
3189template <
typename _Tp>
3190 inline constexpr bool is_union_v = __is_union(_Tp);
3191template <
typename _Tp>
3192 inline constexpr bool is_class_v = __is_class(_Tp);
3193template <
typename _Tp>
3195template <
typename _Tp>
3196 inline constexpr bool is_reference_v =
false;
3197template <
typename _Tp>
3198 inline constexpr bool is_reference_v<_Tp&> =
true;
3199template <
typename _Tp>
3200 inline constexpr bool is_reference_v<_Tp&&> =
true;
3201template <
typename _Tp>
3203template <
typename _Tp>
3205template <
typename _Tp>
3207template <
typename _Tp>
3209template <
typename _Tp>
3211template <
typename _Tp>
3213template <
typename _Tp>
3214 inline constexpr bool is_const_v =
false;
3215template <
typename _Tp>
3216 inline constexpr bool is_const_v<const _Tp> =
true;
3217template <
typename _Tp>
3218 inline constexpr bool is_volatile_v =
false;
3219template <
typename _Tp>
3220 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3222template <
typename _Tp>
3223 inline constexpr bool is_trivial_v = __is_trivial(_Tp);
3224template <
typename _Tp>
3225 inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3226template <
typename _Tp>
3227 inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
3228template <
typename _Tp>
3229 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3230 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3231template <typename _Tp>
3232 _GLIBCXX17_DEPRECATED
3233 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3234template <typename _Tp>
3235 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3236template <typename _Tp>
3237 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3238template <typename _Tp>
3239 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3240template <typename _Tp>
3241 inline constexpr
bool is_final_v = __is_final(_Tp);
3243template <typename _Tp>
3244 inline constexpr
bool is_signed_v =
is_signed<_Tp>::value;
3245template <typename _Tp>
3246 inline constexpr
bool is_unsigned_v =
is_unsigned<_Tp>::value;
3248template <typename _Tp, typename... _Args>
3249 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3250template <typename _Tp>
3251 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3252template <typename _Tp>
3253 inline constexpr
bool is_copy_constructible_v
3254 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3255template <typename _Tp>
3256 inline constexpr
bool is_move_constructible_v
3257 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3259template <typename _Tp, typename _Up>
3260 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3261template <typename _Tp>
3262 inline constexpr
bool is_copy_assignable_v
3263 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3264template <typename _Tp>
3265 inline constexpr
bool is_move_assignable_v
3266 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3268template <typename _Tp>
3269 inline constexpr
bool is_destructible_v =
is_destructible<_Tp>::value;
3271template <typename _Tp, typename... _Args>
3272 inline constexpr
bool is_trivially_constructible_v
3273 = __is_trivially_constructible(_Tp, _Args...);
3274template <typename _Tp>
3275 inline constexpr
bool is_trivially_default_constructible_v
3276 = __is_trivially_constructible(_Tp);
3277template <typename _Tp>
3278 inline constexpr
bool is_trivially_copy_constructible_v
3279 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3280template <typename _Tp>
3281 inline constexpr
bool is_trivially_move_constructible_v
3282 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3284template <typename _Tp, typename _Up>
3285 inline constexpr
bool is_trivially_assignable_v
3286 = __is_trivially_assignable(_Tp, _Up);
3287template <typename _Tp>
3288 inline constexpr
bool is_trivially_copy_assignable_v
3289 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3290 __add_lval_ref_t<const _Tp>);
3291template <typename _Tp>
3292 inline constexpr
bool is_trivially_move_assignable_v
3293 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3294 __add_rval_ref_t<_Tp>);
3295template <typename _Tp>
3296 inline constexpr
bool is_trivially_destructible_v =
3298template <typename _Tp, typename... _Args>
3299 inline constexpr
bool is_nothrow_constructible_v
3300 = __is_nothrow_constructible(_Tp, _Args...);
3301template <typename _Tp>
3302 inline constexpr
bool is_nothrow_default_constructible_v
3303 = __is_nothrow_constructible(_Tp);
3304template <typename _Tp>
3305 inline constexpr
bool is_nothrow_copy_constructible_v
3306 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3307template <typename _Tp>
3308 inline constexpr
bool is_nothrow_move_constructible_v
3309 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3311template <typename _Tp, typename _Up>
3312 inline constexpr
bool is_nothrow_assignable_v
3313 = __is_nothrow_assignable(_Tp, _Up);
3314template <typename _Tp>
3315 inline constexpr
bool is_nothrow_copy_assignable_v
3316 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3317 __add_lval_ref_t<const _Tp>);
3318template <typename _Tp>
3319 inline constexpr
bool is_nothrow_move_assignable_v
3320 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3322template <typename _Tp>
3323 inline constexpr
bool is_nothrow_destructible_v =
3326template <typename _Tp>
3327 inline constexpr
bool has_virtual_destructor_v
3328 = __has_virtual_destructor(_Tp);
3330template <typename _Tp>
3331 inline constexpr
size_t alignment_of_v =
alignment_of<_Tp>::value;
3333template <typename _Tp>
3334 inline constexpr
size_t rank_v = 0;
3335template <typename _Tp,
size_t _Size>
3336 inline constexpr
size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3337template <typename _Tp>
3338 inline constexpr
size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3340template <typename _Tp,
unsigned _Idx = 0>
3341 inline constexpr
size_t extent_v = 0;
3342template <typename _Tp,
size_t _Size>
3343 inline constexpr
size_t extent_v<_Tp[_Size], 0> = _Size;
3344template <typename _Tp,
unsigned _Idx,
size_t _Size>
3345 inline constexpr
size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3346template <typename _Tp>
3347 inline constexpr
size_t extent_v<_Tp[], 0> = 0;
3348template <typename _Tp,
unsigned _Idx>
3349 inline constexpr
size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3351#ifdef _GLIBCXX_HAVE_BUILTIN_IS_SAME
3352template <
typename _Tp,
typename _Up>
3353 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3355template <
typename _Tp,
typename _Up>
3356 inline constexpr bool is_same_v =
false;
3357template <
typename _Tp>
3358 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3360template <
typename _Base,
typename _Derived>
3361 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3362template <
typename _From,
typename _To>
3363 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3364template<
typename _Fn,
typename... _Args>
3365 inline constexpr bool is_invocable_v =
is_invocable<_Fn, _Args...>::value;
3366template<
typename _Fn,
typename... _Args>
3367 inline constexpr bool is_nothrow_invocable_v
3369template<
typename _Ret,
typename _Fn,
typename... _Args>
3370 inline constexpr bool is_invocable_r_v
3372template<
typename _Ret,
typename _Fn,
typename... _Args>
3373 inline constexpr bool is_nothrow_invocable_r_v
3377#ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP
3378# define __cpp_lib_has_unique_object_representations 201606L
3381 template<
typename _Tp>
3384 remove_cv_t<remove_all_extents_t<_Tp>>
3387 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3388 "template argument must be a complete class or an unbounded array");
3392 template<
typename _Tp>
3393 inline constexpr bool has_unique_object_representations_v
3397#ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE
3398# define __cpp_lib_is_aggregate 201703L
3401 template<
typename _Tp>
3410 template<
typename _Tp>
3415#if __cplusplus >= 202002L
3421#define __cpp_lib_remove_cvref 201711L
3423#if __has_builtin(__remove_cvref)
3424 template<
typename _Tp>
3426 {
using type = __remove_cvref(_Tp); };
3428 template<
typename _Tp>
3430 {
using type =
typename remove_cv<_Tp>::type; };
3432 template<
typename _Tp>
3433 struct remove_cvref<_Tp&>
3434 {
using type =
typename remove_cv<_Tp>::type; };
3436 template<
typename _Tp>
3437 struct remove_cvref<_Tp&&>
3438 {
using type =
typename remove_cv<_Tp>::type; };
3441 template<
typename _Tp>
3449#define __cpp_lib_type_identity 201806L
3450 template<
typename _Tp>
3451 struct type_identity {
using type = _Tp; };
3453 template<
typename _Tp>
3457#define __cpp_lib_unwrap_ref 201811L
3463 template<
typename _Tp>
3466 template<
typename _Tp>
3469 template<
typename _Tp>
3470 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3477 template<
typename _Tp>
3480 template<
typename _Tp>
3481 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3484#define __cpp_lib_bounded_array_traits 201902L
3489 template<
typename _Tp>
3492 template<
typename _Tp,
size_t _Size>
3493 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
3498 template<
typename _Tp>
3501 template<
typename _Tp>
3502 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
3506 template<
typename _Tp>
3513 template<
typename _Tp>
3518#if __has_builtin(__is_layout_compatible)
3521 template<
typename _Tp,
typename _Up>
3528 template<
typename _Tp,
typename _Up>
3530 = __is_layout_compatible(_Tp, _Up);
3532#if __has_builtin(__builtin_is_corresponding_member)
3533#define __cpp_lib_is_layout_compatible 201907L
3536 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
3539 {
return __builtin_is_corresponding_member(__m1, __m2); }
3543#if __has_builtin(__is_pointer_interconvertible_base_of)
3546 template<
typename _Base,
typename _Derived>
3548 :
bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
3553 template<
typename _Base,
typename _Derived>
3555 = __is_pointer_interconvertible_base_of(_Base, _Derived);
3557#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
3558#define __cpp_lib_is_pointer_interconvertible 201907L
3563 template<
typename _Tp,
typename _Mem>
3566 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
3570#if __cplusplus > 202002L
3571#define __cpp_lib_is_scoped_enum 202011L
3576 template<
typename _Tp>
3577 struct is_scoped_enum
3581 template<
typename _Tp>
3582 requires __is_enum(_Tp)
3583 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
3584 struct is_scoped_enum<_Tp>
3585 :
bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3590 template<
typename _Tp>
3591 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3593#if __has_builtin(__reference_constructs_from_temporary) \
3594 && __has_builtin(__reference_converts_from_temporary)
3596#define __cpp_lib_reference_from_temporary 202202L
3602 template<
typename _Tp,
typename _Up>
3603 struct reference_constructs_from_temporary
3604 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
3606 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3607 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3608 "template argument must be a complete class or an unbounded array");
3615 template<
typename _Tp,
typename _Up>
3616 struct reference_converts_from_temporary
3617 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
3619 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3620 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3621 "template argument must be a complete class or an unbounded array");
3626 template<
typename _Tp,
typename _Up>
3627 inline constexpr bool reference_constructs_from_temporary_v
3628 = reference_constructs_from_temporary<_Tp, _Up>::value;
3632 template<
typename _Tp,
typename _Up>
3633 inline constexpr bool reference_converts_from_temporary_v
3634 = reference_converts_from_temporary<_Tp, _Up>::value;
3638#if _GLIBCXX_HAVE_IS_CONSTANT_EVALUATED
3639#define __cpp_lib_is_constant_evaluated 201811L
3643 constexpr inline bool
3646#if __cpp_if_consteval >= 202106L
3647 if consteval {
return true; }
else {
return false; }
3649 return __builtin_is_constant_evaluated();
3655 template<
typename _From,
typename _To>
3656 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3658 template<
typename _Xp,
typename _Yp>
3660 =
decltype(
false ? declval<_Xp(&)()>()() : declval<_Yp(&)()>()());
3662 template<
typename _Ap,
typename _Bp,
typename =
void>
3663 struct __common_ref_impl
3667 template<
typename _Ap,
typename _Bp>
3668 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3671 template<
typename _Xp,
typename _Yp>
3672 using __condres_cvref
3673 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
3676 template<
typename _Xp,
typename _Yp>
3677 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
3678 : enable_if<is_reference_v<__condres_cvref<_Xp, _Yp>>,
3679 __condres_cvref<_Xp, _Yp>>
3683 template<
typename _Xp,
typename _Yp>
3684 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3687 template<
typename _Xp,
typename _Yp>
3688 struct __common_ref_impl<_Xp&&, _Yp&&,
3689 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3690 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3691 {
using type = __common_ref_C<_Xp, _Yp>; };
3694 template<
typename _Xp,
typename _Yp>
3695 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3698 template<
typename _Xp,
typename _Yp>
3699 struct __common_ref_impl<_Xp&&, _Yp&,
3700 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3701 {
using type = __common_ref_D<_Xp, _Yp>; };
3704 template<
typename _Xp,
typename _Yp>
3705 struct __common_ref_impl<_Xp&, _Yp&&>
3706 : __common_ref_impl<_Yp&&, _Xp&>
3710 template<
typename _Tp,
typename _Up,
3711 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3712 struct basic_common_reference
3716 template<
typename _Tp>
3718 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3720 template<
typename _Tp>
3722 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3724 template<
typename _Tp>
3725 struct __xref<_Tp&&>
3726 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3728 template<
typename _Tp1,
typename _Tp2>
3729 using __basic_common_ref
3730 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3731 remove_cvref_t<_Tp2>,
3732 __xref<_Tp1>::template __type,
3733 __xref<_Tp2>::template __type>::type;
3736 template<
typename... _Tp>
3737 struct common_reference;
3739 template<
typename... _Tp>
3740 using common_reference_t =
typename common_reference<_Tp...>::type;
3744 struct common_reference<>
3748 template<
typename _Tp0>
3749 struct common_reference<_Tp0>
3750 {
using type = _Tp0; };
3753 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3754 struct __common_reference_impl
3755 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3759 template<
typename _Tp1,
typename _Tp2>
3760 struct common_reference<_Tp1, _Tp2>
3761 : __common_reference_impl<_Tp1, _Tp2>
3765 template<
typename _Tp1,
typename _Tp2>
3766 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3767 void_t<__common_ref<_Tp1&, _Tp2&>>>
3768 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3770 template<
typename _Tp1,
typename _Tp2>
3771 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3772 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3773 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3775 template<
typename _Tp1,
typename _Tp2>
3776 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3777 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3778 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3780 template<
typename _Tp1,
typename _Tp2>
3781 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3782 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3783 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3786 template<
typename _Tp1,
typename _Tp2>
3787 struct __common_reference_impl<_Tp1, _Tp2, 2,
3788 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3789 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3792 template<
typename _Tp1,
typename _Tp2>
3793 struct __common_reference_impl<_Tp1, _Tp2, 3,
3794 void_t<__cond_res<_Tp1, _Tp2>>>
3795 {
using type = __cond_res<_Tp1, _Tp2>; };
3798 template<
typename _Tp1,
typename _Tp2>
3799 struct __common_reference_impl<_Tp1, _Tp2, 4,
3801 {
using type = common_type_t<_Tp1, _Tp2>; };
3804 template<
typename _Tp1,
typename _Tp2>
3805 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3809 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3810 struct common_reference<_Tp1, _Tp2, _Rest...>
3811 : __common_type_fold<common_reference<_Tp1, _Tp2>,
3812 __common_type_pack<_Rest...>>
3816 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3817 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
3818 __common_type_pack<_Rest...>,
3819 void_t<common_reference_t<_Tp1, _Tp2>>>
3820 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
3828_GLIBCXX_END_NAMESPACE_VERSION
typename type_identity< _Tp >::type type_identity_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.
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.
GNU extensions for public use.
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