29#ifndef _GLIBCXX_TYPE_TRAITS
30#define _GLIBCXX_TYPE_TRAITS 1
32#pragma GCC system_header
34#if __cplusplus < 201103L
40#define __glibcxx_want_bool_constant
41#define __glibcxx_want_bounded_array_traits
42#define __glibcxx_want_has_unique_object_representations
43#define __glibcxx_want_integral_constant_callable
44#define __glibcxx_want_is_aggregate
45#define __glibcxx_want_is_constant_evaluated
46#define __glibcxx_want_is_final
47#define __glibcxx_want_is_invocable
48#define __glibcxx_want_is_layout_compatible
49#define __glibcxx_want_is_nothrow_convertible
50#define __glibcxx_want_is_null_pointer
51#define __glibcxx_want_is_pointer_interconvertible
52#define __glibcxx_want_is_scoped_enum
53#define __glibcxx_want_is_swappable
54#define __glibcxx_want_logical_traits
55#define __glibcxx_want_reference_from_temporary
56#define __glibcxx_want_remove_cvref
57#define __glibcxx_want_result_of_sfinae
58#define __glibcxx_want_transformation_trait_aliases
59#define __glibcxx_want_type_identity
60#define __glibcxx_want_type_trait_variable_templates
61#define __glibcxx_want_unwrap_ref
62#define __glibcxx_want_void_t
65namespace std _GLIBCXX_VISIBILITY(default)
67_GLIBCXX_BEGIN_NAMESPACE_VERSION
69 template<
typename _Tp>
70 class reference_wrapper;
86 template<
typename _Tp, _Tp __v>
89 static constexpr _Tp value = __v;
90 using value_type = _Tp;
92 constexpr operator value_type()
const noexcept {
return value; }
94#ifdef __cpp_lib_integral_constant_callable
95 constexpr value_type operator()()
const noexcept {
return value; }
99#if ! __cpp_inline_variables
100 template<
typename _Tp, _Tp __v>
116#ifdef __cpp_lib_bool_constant
120 using bool_constant = __bool_constant<__v>;
127 template<
bool,
typename _Tp =
void>
132 template<
typename _Tp>
134 {
using type = _Tp; };
137 template<
bool _Cond,
typename _Tp =
void>
138 using __enable_if_t =
typename enable_if<_Cond, _Tp>::type;
143 template<
typename _Tp,
typename>
148 struct __conditional<false>
150 template<
typename,
typename _Up>
155 template<
bool _Cond,
typename _If,
typename _Else>
156 using __conditional_t
157 =
typename __conditional<_Cond>::template type<_If, _Else>;
160 template <
typename _Type>
161 struct __type_identity
162 {
using type = _Type; };
164 template<
typename _Tp>
165 using __type_identity_t =
typename __type_identity<_Tp>::type;
170 template<
typename _Tp,
typename...>
171 using __first_t = _Tp;
174 template<
typename... _Bn>
176 __enable_if_t<!bool(_Bn::value)>...>;
178 template<
typename... _Bn>
181 template<
typename... _Bn>
182 auto __and_fn(
int) -> __first_t<
true_type,
183 __enable_if_t<bool(_Bn::value)>...>;
185 template<
typename... _Bn>
192 template<
typename... _Bn>
194 : decltype(__detail::__or_fn<_Bn...>(0))
197 template<
typename... _Bn>
199 : decltype(__detail::__and_fn<_Bn...>(0))
202 template<
typename _Pp>
204 : __bool_constant<!bool(_Pp::value)>
208#ifdef __cpp_lib_logical_traits
211 template<
typename... _Bn>
212 inline constexpr bool __or_v = __or_<_Bn...>::value;
213 template<
typename... _Bn>
214 inline constexpr bool __and_v = __and_<_Bn...>::value;
218 template<
typename ,
typename _B1,
typename... _Bn>
219 struct __disjunction_impl
220 {
using type = _B1; };
222 template<
typename _B1,
typename _B2,
typename... _Bn>
223 struct __disjunction_impl<__enable_if_t<!bool(_B1::value)>, _B1, _B2, _Bn...>
224 {
using type =
typename __disjunction_impl<void, _B2, _Bn...>::type; };
226 template<
typename ,
typename _B1,
typename... _Bn>
227 struct __conjunction_impl
228 {
using type = _B1; };
230 template<
typename _B1,
typename _B2,
typename... _Bn>
231 struct __conjunction_impl<__enable_if_t<bool(_B1::value)>, _B1, _B2, _Bn...>
232 {
using type =
typename __conjunction_impl<void, _B2, _Bn...>::type; };
236 template<
typename... _Bn>
238 : __detail::__conjunction_impl<void, _Bn...>::type
246 template<
typename... _Bn>
248 : __detail::__disjunction_impl<void, _Bn...>::type
256 template<
typename _Pp>
264 template<
typename... _Bn>
265 inline constexpr bool conjunction_v = conjunction<_Bn...>::value;
267 template<
typename... _Bn>
268 inline constexpr bool disjunction_v = disjunction<_Bn...>::value;
270 template<
typename _Pp>
271 inline constexpr bool negation_v = negation<_Pp>::value;
290 struct __is_array_unknown_bounds;
295 template <
typename _Tp,
size_t = sizeof(_Tp)>
296 constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>)
299 template <
typename _TypeIdentity,
300 typename _NestedType =
typename _TypeIdentity::type>
301 constexpr typename __or_<
302 is_reference<_NestedType>,
303 is_function<_NestedType>,
304 is_void<_NestedType>,
305 __is_array_unknown_bounds<_NestedType>
306 >::type __is_complete_or_unbounded(_TypeIdentity)
310 template<
typename _Tp>
311 using __remove_cv_t =
typename remove_cv<_Tp>::type;
317 template<
typename _Tp>
326 struct is_void<const void>
330 struct is_void<volatile void>
334 struct is_void<const volatile void>
339 struct __is_integral_helper
343 struct __is_integral_helper<bool>
347 struct __is_integral_helper<char>
351 struct __is_integral_helper<signed char>
355 struct __is_integral_helper<unsigned char>
362 struct __is_integral_helper<wchar_t>
365#ifdef _GLIBCXX_USE_CHAR8_T
367 struct __is_integral_helper<char8_t>
372 struct __is_integral_helper<char16_t>
376 struct __is_integral_helper<char32_t>
380 struct __is_integral_helper<short>
384 struct __is_integral_helper<unsigned short>
388 struct __is_integral_helper<int>
392 struct __is_integral_helper<unsigned int>
396 struct __is_integral_helper<long>
400 struct __is_integral_helper<unsigned long>
404 struct __is_integral_helper<long long>
408 struct __is_integral_helper<unsigned long long>
413#if defined(__GLIBCXX_TYPE_INT_N_0)
416 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
421 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
424#if defined(__GLIBCXX_TYPE_INT_N_1)
427 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
432 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
435#if defined(__GLIBCXX_TYPE_INT_N_2)
438 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
443 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
446#if defined(__GLIBCXX_TYPE_INT_N_3)
449 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
454 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
460 template<
typename _Tp>
462 :
public __is_integral_helper<__remove_cv_t<_Tp>>::type
467 struct __is_floating_point_helper
471 struct __is_floating_point_helper<float>
475 struct __is_floating_point_helper<double>
479 struct __is_floating_point_helper<long double>
482#ifdef __STDCPP_FLOAT16_T__
484 struct __is_floating_point_helper<_Float16>
488#ifdef __STDCPP_FLOAT32_T__
490 struct __is_floating_point_helper<_Float32>
494#ifdef __STDCPP_FLOAT64_T__
496 struct __is_floating_point_helper<_Float64>
500#ifdef __STDCPP_FLOAT128_T__
502 struct __is_floating_point_helper<_Float128>
506#ifdef __STDCPP_BFLOAT16_T__
508 struct __is_floating_point_helper<
__gnu_cxx::__bfloat16_t>
512#if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) && !defined(__CUDACC__)
514 struct __is_floating_point_helper<__float128>
520 template<
typename _Tp>
522 :
public __is_floating_point_helper<__remove_cv_t<_Tp>>::type
526#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
527 template<
typename _Tp>
529 :
public __bool_constant<__is_array(_Tp)>
536 template<
typename _Tp, std::
size_t _Size>
540 template<
typename _Tp>
541 struct is_array<_Tp[]>
546 struct __is_pointer_helper
549 template<
typename _Tp>
550 struct __is_pointer_helper<_Tp*>
554 template<
typename _Tp>
556 :
public __is_pointer_helper<__remove_cv_t<_Tp>>::type
564 template<
typename _Tp>
573 template<
typename _Tp>
578#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
579 template<
typename _Tp>
580 struct is_member_object_pointer
581 :
public __bool_constant<__is_member_object_pointer(_Tp)>
588 template<
typename _Tp,
typename _Cp>
590 :
public __not_<is_function<_Tp>>::type { };
593 template<
typename _Tp>
594 struct is_member_object_pointer
595 :
public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type
599#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
601 template<
typename _Tp>
602 struct is_member_function_pointer
603 :
public __bool_constant<__is_member_function_pointer(_Tp)>
607 struct __is_member_function_pointer_helper
610 template<
typename _Tp,
typename _Cp>
611 struct __is_member_function_pointer_helper<_Tp _Cp::*>
612 :
public is_function<_Tp>::type { };
615 template<
typename _Tp>
617 :
public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type
622 template<
typename _Tp>
624 :
public __bool_constant<__is_enum(_Tp)>
628 template<
typename _Tp>
630 :
public __bool_constant<__is_union(_Tp)>
634 template<
typename _Tp>
636 :
public __bool_constant<__is_class(_Tp)>
640#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
641 template<
typename _Tp>
643 :
public __bool_constant<__is_function(_Tp)>
646 template<
typename _Tp>
648 :
public __bool_constant<!is_const<const _Tp>::value> { };
650 template<
typename _Tp>
654 template<
typename _Tp>
655 struct is_function<_Tp&&>
659#ifdef __cpp_lib_is_null_pointer
661 template<typename _Tp>
662 struct is_null_pointer
666 struct is_null_pointer<
std::nullptr_t>
670 struct is_null_pointer<const
std::nullptr_t>
674 struct is_null_pointer<volatile
std::nullptr_t>
678 struct is_null_pointer<const volatile
std::nullptr_t>
683 template<
typename _Tp>
684 struct __is_nullptr_t
685 :
public is_null_pointer<_Tp>
686 { } _GLIBCXX_DEPRECATED_SUGGEST(
"std::is_null_pointer");
692#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
693 template<
typename _Tp>
695 :
public __bool_constant<__is_reference(_Tp)>
698 template<
typename _Tp>
703 template<
typename _Tp>
708 template<
typename _Tp>
709 struct is_reference<_Tp&&>
715 template<
typename _Tp>
717 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
721 template<
typename _Tp>
723 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
724 is_null_pointer<_Tp>>::type
728#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
729 template<
typename _Tp>
731 :
public __bool_constant<__is_object(_Tp)>
734 template<
typename _Tp>
736 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
745 template<
typename _Tp>
747 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
748 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
752 template<
typename _Tp>
754 :
public __bool_constant<!is_fundamental<_Tp>::value> { };
757#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
758 template<
typename _Tp>
760 :
public __bool_constant<__is_member_pointer(_Tp)>
764 template<
typename _Tp>
765 struct __is_member_pointer_helper
768 template<
typename _Tp,
typename _Cp>
769 struct __is_member_pointer_helper<_Tp _Cp::*>
773 template<
typename _Tp>
775 :
public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type
779 template<
typename,
typename>
783 template<
typename _Tp,
typename... _Types>
784 using __is_one_of = __or_<is_same<_Tp, _Types>...>;
788 template<
typename _Tp>
789 using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>,
790 signed char,
signed short,
signed int,
signed long,
792#if defined(__GLIBCXX_TYPE_INT_N_0)
793 ,
signed __GLIBCXX_TYPE_INT_N_0
795#if defined(__GLIBCXX_TYPE_INT_N_1)
796 ,
signed __GLIBCXX_TYPE_INT_N_1
798#if defined(__GLIBCXX_TYPE_INT_N_2)
799 ,
signed __GLIBCXX_TYPE_INT_N_2
801#if defined(__GLIBCXX_TYPE_INT_N_3)
802 ,
signed __GLIBCXX_TYPE_INT_N_3
808 template<
typename _Tp>
809 using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>,
810 unsigned char,
unsigned short,
unsigned int,
unsigned long,
812#if defined(__GLIBCXX_TYPE_INT_N_0)
813 ,
unsigned __GLIBCXX_TYPE_INT_N_0
815#if defined(__GLIBCXX_TYPE_INT_N_1)
816 ,
unsigned __GLIBCXX_TYPE_INT_N_1
818#if defined(__GLIBCXX_TYPE_INT_N_2)
819 ,
unsigned __GLIBCXX_TYPE_INT_N_2
821#if defined(__GLIBCXX_TYPE_INT_N_3)
822 ,
unsigned __GLIBCXX_TYPE_INT_N_3
827 template<
typename _Tp>
828 using __is_standard_integer
829 = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>;
832 template<
typename...>
using __void_t = void;
842 template<
typename _Tp>
851 template<
typename _Tp>
856 template<
typename _Tp>
858 :
public __bool_constant<__is_trivial(_Tp)>
860 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
861 "template argument must be a complete class or an unbounded array");
865 template<
typename _Tp>
867 :
public __bool_constant<__is_trivially_copyable(_Tp)>
869 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
870 "template argument must be a complete class or an unbounded array");
874 template<
typename _Tp>
876 :
public __bool_constant<__is_standard_layout(_Tp)>
878 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
879 "template argument must be a complete class or an unbounded array");
887 template<
typename _Tp>
889 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout && is_trivial")
891 : public __bool_constant<__is_pod(_Tp)>
893 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
894 "template argument must be a complete class or an unbounded array");
901 template<
typename _Tp>
903 _GLIBCXX17_DEPRECATED
905 :
public __bool_constant<__is_literal_type(_Tp)>
907 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
908 "template argument must be a complete class or an unbounded array");
912 template<
typename _Tp>
914 :
public __bool_constant<__is_empty(_Tp)>
918 template<
typename _Tp>
920 :
public __bool_constant<__is_polymorphic(_Tp)>
923#ifdef __cpp_lib_is_final
926 template<typename _Tp>
928 :
public __bool_constant<__is_final(_Tp)>
933 template<
typename _Tp>
935 :
public __bool_constant<__is_abstract(_Tp)>
939 template<
typename _Tp,
941 struct __is_signed_helper
944 template<
typename _Tp>
945 struct __is_signed_helper<_Tp, true>
946 :
public __bool_constant<_Tp(-1) < _Tp(0)>
951 template<typename _Tp>
953 : public __is_signed_helper<_Tp>::type
957 template<typename _Tp>
959 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
963 template<typename _Tp, typename _Up = _Tp&&>
967 template<typename _Tp>
972 template<typename _Tp>
973 auto declval() noexcept -> decltype(__declval<_Tp>(0));
979 template<typename _Tp>
980 struct __is_array_known_bounds
984 template<
typename _Tp,
size_t _Size>
985 struct __is_array_known_bounds<_Tp[_Size]>
989 template<
typename _Tp>
990 struct __is_array_unknown_bounds
994 template<
typename _Tp>
995 struct __is_array_unknown_bounds<_Tp[]>
1006 struct __do_is_destructible_impl
1008 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
1015 template<
typename _Tp>
1016 struct __is_destructible_impl
1017 :
public __do_is_destructible_impl
1019 using type =
decltype(__test<_Tp>(0));
1022 template<
typename _Tp,
1023 bool = __or_<is_void<_Tp>,
1024 __is_array_unknown_bounds<_Tp>,
1025 is_function<_Tp>>::value,
1026 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
1027 struct __is_destructible_safe;
1029 template<
typename _Tp>
1030 struct __is_destructible_safe<_Tp, false, false>
1031 :
public __is_destructible_impl<typename
1032 remove_all_extents<_Tp>::type>::type
1035 template<
typename _Tp>
1036 struct __is_destructible_safe<_Tp, true, false>
1039 template<
typename _Tp>
1040 struct __is_destructible_safe<_Tp, false, true>
1045 template<
typename _Tp>
1047 :
public __is_destructible_safe<_Tp>::type
1049 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1050 "template argument must be a complete class or an unbounded array");
1059 struct __do_is_nt_destructible_impl
1061 template<
typename _Tp>
1062 static __bool_constant<noexcept(declval<_Tp&>().~_Tp())>
1069 template<
typename _Tp>
1070 struct __is_nt_destructible_impl
1071 :
public __do_is_nt_destructible_impl
1073 using type =
decltype(__test<_Tp>(0));
1076 template<
typename _Tp,
1077 bool = __or_<is_void<_Tp>,
1078 __is_array_unknown_bounds<_Tp>,
1079 is_function<_Tp>>::value,
1080 bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
1081 struct __is_nt_destructible_safe;
1083 template<
typename _Tp>
1084 struct __is_nt_destructible_safe<_Tp, false, false>
1085 :
public __is_nt_destructible_impl<typename
1086 remove_all_extents<_Tp>::type>::type
1089 template<
typename _Tp>
1090 struct __is_nt_destructible_safe<_Tp, true, false>
1093 template<
typename _Tp>
1094 struct __is_nt_destructible_safe<_Tp, false, true>
1099 template<
typename _Tp>
1101 :
public __is_nt_destructible_safe<_Tp>::type
1103 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1104 "template argument must be a complete class or an unbounded array");
1108 template<
typename _Tp,
typename... _Args>
1109 using __is_constructible_impl
1110 = __bool_constant<__is_constructible(_Tp, _Args...)>;
1114 template<
typename _Tp,
typename... _Args>
1116 :
public __is_constructible_impl<_Tp, _Args...>
1118 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1119 "template argument must be a complete class or an unbounded array");
1123 template<
typename _Tp>
1125 :
public __is_constructible_impl<_Tp>
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,
typename =
void>
1133 struct __add_lvalue_reference_helper
1134 {
using type = _Tp; };
1136 template<
typename _Tp>
1137 struct __add_lvalue_reference_helper<_Tp, __void_t<_Tp&>>
1138 {
using type = _Tp&; };
1140 template<
typename _Tp>
1141 using __add_lval_ref_t =
typename __add_lvalue_reference_helper<_Tp>::type;
1145 template<
typename _Tp>
1147 :
public __is_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1149 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1150 "template argument must be a complete class or an unbounded array");
1154 template<
typename _Tp,
typename =
void>
1155 struct __add_rvalue_reference_helper
1156 {
using type = _Tp; };
1158 template<
typename _Tp>
1159 struct __add_rvalue_reference_helper<_Tp, __void_t<_Tp&&>>
1160 {
using type = _Tp&&; };
1162 template<
typename _Tp>
1163 using __add_rval_ref_t =
typename __add_rvalue_reference_helper<_Tp>::type;
1167 template<
typename _Tp>
1169 :
public __is_constructible_impl<_Tp, __add_rval_ref_t<_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,
typename... _Args>
1177 using __is_nothrow_constructible_impl
1178 = __bool_constant<__is_nothrow_constructible(_Tp, _Args...)>;
1182 template<
typename _Tp,
typename... _Args>
1184 :
public __is_nothrow_constructible_impl<_Tp, _Args...>
1186 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1187 "template argument must be a complete class or an unbounded array");
1191 template<
typename _Tp>
1193 :
public __is_nothrow_constructible_impl<_Tp>
1195 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1196 "template argument must be a complete class or an unbounded array");
1200 template<
typename _Tp>
1202 :
public __is_nothrow_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1204 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1205 "template argument must be a complete class or an unbounded array");
1209 template<
typename _Tp>
1211 :
public __is_nothrow_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1213 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1214 "template argument must be a complete class or an unbounded array");
1218 template<
typename _Tp,
typename _Up>
1219 using __is_assignable_impl = __bool_constant<__is_assignable(_Tp, _Up)>;
1223 template<
typename _Tp,
typename _Up>
1225 :
public __is_assignable_impl<_Tp, _Up>
1227 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1228 "template argument must be a complete class or an unbounded array");
1232 template<
typename _Tp>
1234 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>,
1235 __add_lval_ref_t<const _Tp>>
1237 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1238 "template argument must be a complete class or an unbounded array");
1242 template<
typename _Tp>
1244 :
public __is_assignable_impl<__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>>
1246 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1247 "template argument must be a complete class or an unbounded array");
1251 template<
typename _Tp,
typename _Up>
1252 using __is_nothrow_assignable_impl
1253 = __bool_constant<__is_nothrow_assignable(_Tp, _Up)>;
1257 template<
typename _Tp,
typename _Up>
1259 :
public __is_nothrow_assignable_impl<_Tp, _Up>
1261 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1262 "template argument must be a complete class or an unbounded array");
1266 template<
typename _Tp>
1268 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1269 __add_lval_ref_t<const _Tp>>
1271 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1272 "template argument must be a complete class or an unbounded array");
1276 template<
typename _Tp>
1278 :
public __is_nothrow_assignable_impl<__add_lval_ref_t<_Tp>,
1279 __add_rval_ref_t<_Tp>>
1281 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1282 "template argument must be a complete class or an unbounded array");
1286 template<
typename _Tp,
typename... _Args>
1287 using __is_trivially_constructible_impl
1288 = __bool_constant<__is_trivially_constructible(_Tp, _Args...)>;
1292 template<
typename _Tp,
typename... _Args>
1294 :
public __is_trivially_constructible_impl<_Tp, _Args...>
1296 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1297 "template argument must be a complete class or an unbounded array");
1301 template<
typename _Tp>
1303 :
public __is_trivially_constructible_impl<_Tp>
1305 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1306 "template argument must be a complete class or an unbounded array");
1309#if __cpp_variable_templates && __cpp_concepts
1310 template<
typename _Tp>
1311 constexpr bool __is_implicitly_default_constructible_v
1312 =
requires (void(&__f)(_Tp)) { __f({}); };
1314 template<
typename _Tp>
1315 struct __is_implicitly_default_constructible
1316 : __bool_constant<__is_implicitly_default_constructible_v<_Tp>>
1319 struct __do_is_implicitly_default_constructible_impl
1321 template <
typename _Tp>
1322 static void __helper(
const _Tp&);
1324 template <
typename _Tp>
1326 decltype(__helper<const _Tp&>({}))* = 0);
1331 template<
typename _Tp>
1332 struct __is_implicitly_default_constructible_impl
1333 :
public __do_is_implicitly_default_constructible_impl
1335 using type =
decltype(__test(declval<_Tp>()));
1338 template<
typename _Tp>
1339 struct __is_implicitly_default_constructible_safe
1340 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1343 template <
typename _Tp>
1344 struct __is_implicitly_default_constructible
1345 :
public __and_<__is_constructible_impl<_Tp>,
1346 __is_implicitly_default_constructible_safe<_Tp>>::type
1351 template<
typename _Tp>
1353 :
public __is_trivially_constructible_impl<_Tp, __add_lval_ref_t<const _Tp>>
1355 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1356 "template argument must be a complete class or an unbounded array");
1360 template<
typename _Tp>
1362 :
public __is_trivially_constructible_impl<_Tp, __add_rval_ref_t<_Tp>>
1364 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1365 "template argument must be a complete class or an unbounded array");
1369 template<
typename _Tp,
typename _Up>
1370 using __is_trivially_assignable_impl
1371 = __bool_constant<__is_trivially_assignable(_Tp, _Up)>;
1375 template<
typename _Tp,
typename _Up>
1377 :
public __is_trivially_assignable_impl<_Tp, _Up>
1379 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1380 "template argument must be a complete class or an unbounded array");
1384 template<
typename _Tp>
1386 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1387 __add_lval_ref_t<const _Tp>>
1389 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1390 "template argument must be a complete class or an unbounded array");
1394 template<
typename _Tp>
1396 :
public __is_trivially_assignable_impl<__add_lval_ref_t<_Tp>,
1397 __add_rval_ref_t<_Tp>>
1399 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1400 "template argument must be a complete class or an unbounded array");
1404 template<
typename _Tp>
1406 :
public __and_<__is_destructible_safe<_Tp>,
1407 __bool_constant<__has_trivial_destructor(_Tp)>>::type
1409 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1410 "template argument must be a complete class or an unbounded array");
1415 template<
typename _Tp>
1417 :
public __bool_constant<__has_virtual_destructor(_Tp)>
1419 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1420 "template argument must be a complete class or an unbounded array");
1427 template<
typename _Tp>
1431 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
1432 "template argument must be a complete class or an unbounded array");
1440 template<
typename _Tp, std::
size_t _Size>
1441 struct rank<_Tp[_Size]>
1444 template<
typename _Tp>
1446 :
public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1449 template<
typename,
unsigned _U
int = 0>
1453 template<
typename _Tp,
size_t _Size>
1454 struct extent<_Tp[_Size], 0>
1457 template<
typename _Tp,
unsigned _U
int,
size_t _Size>
1458 struct extent<_Tp[_Size], _Uint>
1459 :
public extent<_Tp, _Uint - 1>::type { };
1461 template<
typename _Tp>
1462 struct extent<_Tp[], 0>
1463 :
public integral_constant<size_t, 0> { };
1465 template<
typename _Tp,
unsigned _U
int>
1466 struct extent<_Tp[], _Uint>
1467 :
public extent<_Tp, _Uint - 1>::type { };
1473#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
1474 template<
typename _Tp,
typename _Up>
1476 :
public __bool_constant<__is_same(_Tp, _Up)>
1479 template<
typename _Tp,
typename _Up>
1484 template<
typename _Tp>
1491 template<
typename _Base,
typename _Derived>
1493 :
public __bool_constant<__is_base_of(_Base, _Derived)>
1496#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
1497 template<
typename _From,
typename _To>
1499 :
public __bool_constant<__is_convertible(_From, _To)>
1502 template<
typename _From,
typename _To,
1503 bool = __or_<is_void<_From>, is_function<_To>,
1504 is_array<_To>>::value>
1505 struct __is_convertible_helper
1507 using type =
typename is_void<_To>::type;
1510#pragma GCC diagnostic push
1511#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1512 template<
typename _From,
typename _To>
1513 class __is_convertible_helper<_From, _To, false>
1515 template<
typename _To1>
1516 static void __test_aux(_To1)
noexcept;
1518 template<
typename _From1,
typename _To1,
1519 typename =
decltype(__test_aux<_To1>(std::declval<_From1>()))>
1523 template<
typename,
typename>
1528 using type =
decltype(__test<_From, _To>(0));
1530#pragma GCC diagnostic pop
1533 template<
typename _From,
typename _To>
1535 :
public __is_convertible_helper<_From, _To>::type
1540 template<
typename _ToElementType,
typename _FromElementType>
1544#ifdef __cpp_lib_is_nothrow_convertible
1546#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_nothrow_convertible)
1548 template<
typename _From,
typename _To>
1549 inline constexpr bool is_nothrow_convertible_v
1550 = __is_nothrow_convertible(_From, _To);
1553 template<
typename _From,
typename _To>
1554 struct is_nothrow_convertible
1555 :
public bool_constant<is_nothrow_convertible_v<_From, _To>>
1558 template<
typename _From,
typename _To,
1559 bool = __or_<is_void<_From>, is_function<_To>,
1560 is_array<_To>>::value>
1561 struct __is_nt_convertible_helper
1565#pragma GCC diagnostic push
1566#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
1567 template<
typename _From,
typename _To>
1568 class __is_nt_convertible_helper<_From, _To, false>
1570 template<
typename _To1>
1571 static void __test_aux(_To1)
noexcept;
1573 template<
typename _From1,
typename _To1>
1575 __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))>
1578 template<
typename,
typename>
1583 using type =
decltype(__test<_From, _To>(0));
1585#pragma GCC diagnostic pop
1588 template<
typename _From,
typename _To>
1589 struct is_nothrow_convertible
1590 :
public __is_nt_convertible_helper<_From, _To>::type
1594 template<
typename _From,
typename _To>
1595 inline constexpr bool is_nothrow_convertible_v
1596 = is_nothrow_convertible<_From, _To>::value;
1600#pragma GCC diagnostic push
1601#pragma GCC diagnostic ignored "-Wc++14-extensions"
1602 template<
typename _Tp,
typename... _Args>
1603 struct __is_nothrow_new_constructible_impl
1605 noexcept(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))
1609 template<
typename _Tp,
typename... _Args>
1610 _GLIBCXX17_INLINE
constexpr bool __is_nothrow_new_constructible
1611 = __and_<is_constructible<_Tp, _Args...>,
1612 __is_nothrow_new_constructible_impl<_Tp, _Args...>>::value;
1613#pragma GCC diagnostic pop
1618 template<
typename _Tp>
1620 {
using type = _Tp; };
1622 template<
typename _Tp>
1624 {
using type = _Tp; };
1627 template<
typename _Tp>
1629 {
using type = _Tp; };
1631 template<
typename _Tp>
1633 {
using type = _Tp; };
1636#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cv)
1637 template<
typename _Tp>
1639 {
using type = __remove_cv(_Tp); };
1641 template<
typename _Tp>
1643 {
using type = _Tp; };
1645 template<
typename _Tp>
1647 {
using type = _Tp; };
1649 template<
typename _Tp>
1650 struct remove_cv<volatile _Tp>
1651 {
using type = _Tp; };
1653 template<
typename _Tp>
1654 struct remove_cv<const volatile _Tp>
1655 {
using type = _Tp; };
1659 template<
typename _Tp>
1661 {
using type = _Tp
const; };
1664 template<
typename _Tp>
1666 {
using type = _Tp
volatile; };
1669 template<
typename _Tp>
1671 {
using type = _Tp
const volatile; };
1673#ifdef __cpp_lib_transformation_trait_aliases
1675 template<typename _Tp>
1676 using remove_const_t =
typename remove_const<_Tp>::type;
1679 template<
typename _Tp>
1680 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1683 template<
typename _Tp>
1684 using remove_cv_t =
typename remove_cv<_Tp>::type;
1687 template<
typename _Tp>
1688 using add_const_t =
typename add_const<_Tp>::type;
1691 template<
typename _Tp>
1692 using add_volatile_t =
typename add_volatile<_Tp>::type;
1695 template<
typename _Tp>
1696 using add_cv_t =
typename add_cv<_Tp>::type;
1702#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_reference)
1703 template<
typename _Tp>
1705 {
using type = __remove_reference(_Tp); };
1707 template<
typename _Tp>
1709 {
using type = _Tp; };
1711 template<
typename _Tp>
1713 {
using type = _Tp; };
1715 template<
typename _Tp>
1716 struct remove_reference<_Tp&&>
1717 {
using type = _Tp; };
1721 template<
typename _Tp>
1723 {
using type = __add_lval_ref_t<_Tp>; };
1726 template<
typename _Tp>
1728 {
using type = __add_rval_ref_t<_Tp>; };
1730#if __cplusplus > 201103L
1732 template<
typename _Tp>
1736 template<
typename _Tp>
1740 template<
typename _Tp>
1749 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1750 struct __cv_selector;
1752 template<
typename _Unqualified>
1753 struct __cv_selector<_Unqualified, false, false>
1754 {
using __type = _Unqualified; };
1756 template<
typename _Unqualified>
1757 struct __cv_selector<_Unqualified, false, true>
1758 {
using __type =
volatile _Unqualified; };
1760 template<
typename _Unqualified>
1761 struct __cv_selector<_Unqualified, true, false>
1762 {
using __type =
const _Unqualified; };
1764 template<
typename _Unqualified>
1765 struct __cv_selector<_Unqualified, true, true>
1766 {
using __type =
const volatile _Unqualified; };
1768 template<
typename _Qualified,
typename _Unqualified,
1769 bool _IsConst = is_const<_Qualified>::value,
1770 bool _IsVol = is_volatile<_Qualified>::value>
1771 class __match_cv_qualifiers
1773 using __match = __cv_selector<_Unqualified, _IsConst, _IsVol>;
1776 using __type =
typename __match::__type;
1780 template<
typename _Tp>
1781 struct __make_unsigned
1782 {
using __type = _Tp; };
1785 struct __make_unsigned<char>
1786 {
using __type =
unsigned char; };
1789 struct __make_unsigned<signed char>
1790 {
using __type =
unsigned char; };
1793 struct __make_unsigned<short>
1794 {
using __type =
unsigned short; };
1797 struct __make_unsigned<int>
1798 {
using __type =
unsigned int; };
1801 struct __make_unsigned<long>
1802 {
using __type =
unsigned long; };
1805 struct __make_unsigned<long long>
1806 {
using __type =
unsigned long long; };
1808#if defined(__GLIBCXX_TYPE_INT_N_0)
1811 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1812 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_0; };
1814#if defined(__GLIBCXX_TYPE_INT_N_1)
1817 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1818 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_1; };
1820#if defined(__GLIBCXX_TYPE_INT_N_2)
1823 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1824 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_2; };
1826#if defined(__GLIBCXX_TYPE_INT_N_3)
1829 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1830 {
using __type =
unsigned __GLIBCXX_TYPE_INT_N_3; };
1834 template<
typename _Tp,
1835 bool _IsInt = is_integral<_Tp>::value,
1836 bool _IsEnum = __is_enum(_Tp)>
1837 class __make_unsigned_selector;
1839 template<
typename _Tp>
1840 class __make_unsigned_selector<_Tp, true, false>
1842 using __unsigned_type
1843 =
typename __make_unsigned<__remove_cv_t<_Tp>>::__type;
1847 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1850 class __make_unsigned_selector_base
1853 template<
typename...>
struct _List { };
1855 template<
typename _Tp,
typename... _Up>
1856 struct _List<_Tp, _Up...> : _List<_Up...>
1857 {
static constexpr size_t __size =
sizeof(_Tp); };
1859 template<
size_t _Sz,
typename _Tp,
bool = (_Sz <= _Tp::__size)>
1862 template<
size_t _Sz,
typename _U
int,
typename... _UInts>
1863 struct __select<_Sz, _List<_Uint, _UInts...>,
true>
1864 {
using __type = _Uint; };
1866 template<
size_t _Sz,
typename _Uint,
typename... _UInts>
1867 struct __select<_Sz, _List<_Uint, _UInts...>, false>
1868 : __select<_Sz, _List<_UInts...>>
1873 template<
typename _Tp>
1874 class __make_unsigned_selector<_Tp, false, true>
1875 : __make_unsigned_selector_base
1878 using _UInts = _List<
unsigned char,
unsigned short,
unsigned int,
1879 unsigned long,
unsigned long long>;
1881 using __unsigned_type =
typename __select<
sizeof(_Tp), _UInts>::__type;
1885 =
typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type;
1893 struct __make_unsigned<wchar_t>
1896 =
typename __make_unsigned_selector<wchar_t, false, true>::__type;
1899#ifdef _GLIBCXX_USE_CHAR8_T
1901 struct __make_unsigned<char8_t>
1904 =
typename __make_unsigned_selector<char8_t, false, true>::__type;
1909 struct __make_unsigned<char16_t>
1912 =
typename __make_unsigned_selector<char16_t, false, true>::__type;
1916 struct __make_unsigned<char32_t>
1919 =
typename __make_unsigned_selector<char32_t, false, true>::__type;
1927 template<
typename _Tp>
1929 {
using type =
typename __make_unsigned_selector<_Tp>::__type; };
1940 template<
typename _Tp>
1941 struct __make_signed
1942 {
using __type = _Tp; };
1945 struct __make_signed<char>
1946 {
using __type =
signed char; };
1949 struct __make_signed<unsigned char>
1950 {
using __type =
signed char; };
1953 struct __make_signed<unsigned short>
1954 {
using __type =
signed short; };
1957 struct __make_signed<unsigned int>
1958 {
using __type =
signed int; };
1961 struct __make_signed<unsigned long>
1962 {
using __type =
signed long; };
1965 struct __make_signed<unsigned long long>
1966 {
using __type =
signed long long; };
1968#if defined(__GLIBCXX_TYPE_INT_N_0)
1971 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1972 {
using __type = __GLIBCXX_TYPE_INT_N_0; };
1974#if defined(__GLIBCXX_TYPE_INT_N_1)
1977 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1978 {
using __type = __GLIBCXX_TYPE_INT_N_1; };
1980#if defined(__GLIBCXX_TYPE_INT_N_2)
1983 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1984 {
using __type = __GLIBCXX_TYPE_INT_N_2; };
1986#if defined(__GLIBCXX_TYPE_INT_N_3)
1989 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1990 {
using __type = __GLIBCXX_TYPE_INT_N_3; };
1994 template<
typename _Tp,
1995 bool _IsInt = is_integral<_Tp>::value,
1996 bool _IsEnum = __is_enum(_Tp)>
1997 class __make_signed_selector;
1999 template<
typename _Tp>
2000 class __make_signed_selector<_Tp, true, false>
2003 =
typename __make_signed<__remove_cv_t<_Tp>>::__type;
2007 =
typename __match_cv_qualifiers<_Tp, __signed_type>::__type;
2011 template<
typename _Tp>
2012 class __make_signed_selector<_Tp, false, true>
2014 using __unsigned_type =
typename __make_unsigned_selector<_Tp>::__type;
2017 using __type =
typename __make_signed_selector<__unsigned_type>::__type;
2025 struct __make_signed<wchar_t>
2028 =
typename __make_signed_selector<wchar_t, false, true>::__type;
2031#if defined(_GLIBCXX_USE_CHAR8_T)
2033 struct __make_signed<char8_t>
2036 =
typename __make_signed_selector<char8_t, false, true>::__type;
2041 struct __make_signed<char16_t>
2044 =
typename __make_signed_selector<char16_t, false, true>::__type;
2048 struct __make_signed<char32_t>
2051 =
typename __make_signed_selector<char32_t, false, true>::__type;
2059 template<
typename _Tp>
2061 {
using type =
typename __make_signed_selector<_Tp>::__type; };
2067 template<>
struct make_signed<bool const volatile>;
2069#if __cplusplus > 201103L
2071 template<
typename _Tp>
2075 template<
typename _Tp>
2082 template<
typename _Tp>
2084 {
using type = _Tp; };
2086 template<
typename _Tp, std::
size_t _Size>
2088 {
using type = _Tp; };
2090 template<
typename _Tp>
2091 struct remove_extent<_Tp[]>
2092 {
using type = _Tp; };
2095 template<
typename _Tp>
2097 {
using type = _Tp; };
2099 template<
typename _Tp, std::
size_t _Size>
2101 {
using type =
typename remove_all_extents<_Tp>::type; };
2103 template<
typename _Tp>
2104 struct remove_all_extents<_Tp[]>
2105 {
using type =
typename remove_all_extents<_Tp>::type; };
2107#if __cplusplus > 201103L
2109 template<
typename _Tp>
2113 template<
typename _Tp>
2120#if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_pointer)
2121 template<
typename _Tp>
2122 struct remove_pointer
2123 {
using type = __remove_pointer(_Tp); };
2125 template<
typename _Tp,
typename>
2127 {
using type = _Tp; };
2129 template<
typename _Tp,
typename _Up>
2131 {
using type = _Up; };
2133 template<
typename _Tp>
2134 struct remove_pointer
2135 :
public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>>
2139 template<
typename _Tp,
typename =
void>
2140 struct __add_pointer_helper
2141 {
using type = _Tp; };
2143 template<
typename _Tp>
2144 struct __add_pointer_helper<_Tp, __void_t<_Tp*>>
2145 {
using type = _Tp*; };
2148 template<
typename _Tp>
2150 :
public __add_pointer_helper<_Tp>
2153 template<
typename _Tp>
2155 {
using type = _Tp*; };
2157 template<
typename _Tp>
2158 struct add_pointer<_Tp&&>
2159 {
using type = _Tp*; };
2161#if __cplusplus > 201103L
2163 template<
typename _Tp>
2167 template<
typename _Tp>
2171 template<std::
size_t _Len>
2172 struct __aligned_storage_msa
2176 unsigned char __data[_Len];
2177 struct __attribute__((__aligned__)) { } __align;
2194 template<std::size_t _Len, std::size_t _Align =
2195 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2197 _GLIBCXX23_DEPRECATED
2202 unsigned char __data[_Len];
2203 struct __attribute__((__aligned__((_Align)))) { } __align;
2207 template <
typename... _Types>
2208 struct __strictest_alignment
2210 static const size_t _S_alignment = 0;
2211 static const size_t _S_size = 0;
2214 template <
typename _Tp,
typename... _Types>
2215 struct __strictest_alignment<_Tp, _Types...>
2217 static const size_t _S_alignment =
2218 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2219 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2220 static const size_t _S_size =
2221 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2222 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2225#pragma GCC diagnostic push
2226#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2240 template <
size_t _Len,
typename... _Types>
2242 _GLIBCXX23_DEPRECATED
2246 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2248 using __strictest = __strictest_alignment<_Types...>;
2249 static const size_t _S_len = _Len > __strictest::_S_size
2250 ? _Len : __strictest::_S_size;
2253 static const size_t alignment_value = __strictest::_S_alignment;
2258 template <
size_t _Len,
typename... _Types>
2259 const size_t aligned_union<_Len, _Types...>::alignment_value;
2260#pragma GCC diagnostic pop
2266 template<
typename _Up>
2267 struct __decay_selector
2268 : __conditional_t<is_const<const _Up>::value,
2273 template<
typename _Up,
size_t _Nm>
2274 struct __decay_selector<_Up[_Nm]>
2275 {
using type = _Up*; };
2277 template<
typename _Up>
2278 struct __decay_selector<_Up[]>
2279 {
using type = _Up*; };
2284 template<
typename _Tp>
2286 {
using type =
typename __decay_selector<_Tp>::type; };
2288 template<
typename _Tp>
2290 {
using type =
typename __decay_selector<_Tp>::type; };
2292 template<
typename _Tp>
2294 {
using type =
typename __decay_selector<_Tp>::type; };
2299 template<
typename _Tp>
2300 struct __strip_reference_wrapper
2305 template<
typename _Tp>
2306 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2308 using __type = _Tp&;
2312 template<
typename _Tp>
2313 using __decay_t =
typename decay<_Tp>::type;
2315 template<
typename _Tp>
2316 using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>;
2322 template<
typename... _Cond>
2323 using _Require = __enable_if_t<__and_<_Cond...>::value>;
2326 template<
typename _Tp>
2327 using __remove_cvref_t
2328 =
typename remove_cv<typename remove_reference<_Tp>::type>::type;
2333 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2335 {
using type = _Iftrue; };
2338 template<
typename _Iftrue,
typename _Iffalse>
2340 {
using type = _Iffalse; };
2343 template<
typename... _Tp>
2355 template<
typename _Tp>
2356 struct __success_type
2357 {
using type = _Tp; };
2359 struct __failure_type
2362 struct __do_common_type_impl
2364 template<
typename _Tp,
typename _Up>
2366 =
decltype(
true ? std::declval<_Tp>() :
std::
declval<_Up>());
2370 template<
typename _Tp,
typename _Up>
2371 static __success_type<__decay_t<__cond_t<_Tp, _Up>>>
2374#if __cplusplus > 201703L
2377 template<
typename _Tp,
typename _Up>
2378 static __success_type<__remove_cvref_t<__cond_t<const _Tp&, const _Up&>>>
2382 template<
typename,
typename>
2383 static __failure_type
2386 template<
typename _Tp,
typename _Up>
2387 static decltype(_S_test_2<_Tp, _Up>(0))
2393 struct common_type<>
2397 template<
typename _Tp0>
2398 struct common_type<_Tp0>
2399 :
public common_type<_Tp0, _Tp0>
2403 template<
typename _Tp1,
typename _Tp2,
2404 typename _Dp1 = __decay_t<_Tp1>,
typename _Dp2 = __decay_t<_Tp2>>
2405 struct __common_type_impl
2409 using type = common_type<_Dp1, _Dp2>;
2412 template<
typename _Tp1,
typename _Tp2>
2413 struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2>
2414 :
private __do_common_type_impl
2418 using type =
decltype(_S_test<_Tp1, _Tp2>(0));
2422 template<
typename _Tp1,
typename _Tp2>
2423 struct common_type<_Tp1, _Tp2>
2424 :
public __common_type_impl<_Tp1, _Tp2>::type
2427 template<
typename...>
2428 struct __common_type_pack
2431 template<
typename,
typename,
typename =
void>
2432 struct __common_type_fold;
2435 template<
typename _Tp1,
typename _Tp2,
typename... _Rp>
2436 struct common_type<_Tp1, _Tp2, _Rp...>
2437 :
public __common_type_fold<common_type<_Tp1, _Tp2>,
2438 __common_type_pack<_Rp...>>
2444 template<
typename _CTp,
typename... _Rp>
2445 struct __common_type_fold<_CTp, __common_type_pack<_Rp...>,
2446 __void_t<typename _CTp::type>>
2447 :
public common_type<typename _CTp::type, _Rp...>
2451 template<
typename _CTp,
typename _Rp>
2452 struct __common_type_fold<_CTp, _Rp, void>
2455 template<
typename _Tp,
bool = __is_enum(_Tp)>
2456 struct __underlying_type_impl
2458 using type = __underlying_type(_Tp);
2461 template<
typename _Tp>
2462 struct __underlying_type_impl<_Tp, false>
2467 template<
typename _Tp>
2469 :
public __underlying_type_impl<_Tp>
2473 template<
typename _Tp>
2474 struct __declval_protector
2476 static const bool __stop =
false;
2484 template<
typename _Tp>
2485 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2487 static_assert(__declval_protector<_Tp>::__stop,
2488 "declval() must not be used!");
2489 return __declval<_Tp>(0);
2493 template<
typename _Signature>
2499 struct __invoke_memfun_ref { };
2500 struct __invoke_memfun_deref { };
2501 struct __invoke_memobj_ref { };
2502 struct __invoke_memobj_deref { };
2503 struct __invoke_other { };
2506 template<
typename _Tp,
typename _Tag>
2507 struct __result_of_success : __success_type<_Tp>
2508 {
using __invoke_type = _Tag; };
2511 struct __result_of_memfun_ref_impl
2513 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2514 static __result_of_success<
decltype(
2515 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2516 ), __invoke_memfun_ref> _S_test(
int);
2518 template<
typename...>
2519 static __failure_type _S_test(...);
2522 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2523 struct __result_of_memfun_ref
2524 :
private __result_of_memfun_ref_impl
2526 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2530 struct __result_of_memfun_deref_impl
2532 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2533 static __result_of_success<
decltype(
2534 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2535 ), __invoke_memfun_deref> _S_test(
int);
2537 template<
typename...>
2538 static __failure_type _S_test(...);
2541 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2542 struct __result_of_memfun_deref
2543 :
private __result_of_memfun_deref_impl
2545 using type =
decltype(_S_test<_MemPtr, _Arg, _Args...>(0));
2549 struct __result_of_memobj_ref_impl
2551 template<
typename _Fp,
typename _Tp1>
2552 static __result_of_success<
decltype(
2553 std::declval<_Tp1>().*std::declval<_Fp>()
2554 ), __invoke_memobj_ref> _S_test(
int);
2556 template<
typename,
typename>
2557 static __failure_type _S_test(...);
2560 template<
typename _MemPtr,
typename _Arg>
2561 struct __result_of_memobj_ref
2562 :
private __result_of_memobj_ref_impl
2564 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2568 struct __result_of_memobj_deref_impl
2570 template<
typename _Fp,
typename _Tp1>
2571 static __result_of_success<
decltype(
2572 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2573 ), __invoke_memobj_deref> _S_test(
int);
2575 template<
typename,
typename>
2576 static __failure_type _S_test(...);
2579 template<
typename _MemPtr,
typename _Arg>
2580 struct __result_of_memobj_deref
2581 :
private __result_of_memobj_deref_impl
2583 using type =
decltype(_S_test<_MemPtr, _Arg>(0));
2586 template<
typename _MemPtr,
typename _Arg>
2587 struct __result_of_memobj;
2589 template<
typename _Res,
typename _Class,
typename _Arg>
2590 struct __result_of_memobj<_Res _Class::*, _Arg>
2592 using _Argval = __remove_cvref_t<_Arg>;
2593 using _MemPtr = _Res _Class::*;
2594 using type =
typename __conditional_t<__or_<is_same<_Argval, _Class>,
2595 is_base_of<_Class, _Argval>>::value,
2596 __result_of_memobj_ref<_MemPtr, _Arg>,
2597 __result_of_memobj_deref<_MemPtr, _Arg>
2601 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2602 struct __result_of_memfun;
2604 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2605 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2607 using _Argval =
typename remove_reference<_Arg>::type;
2608 using _MemPtr = _Res _Class::*;
2609 using type =
typename __conditional_t<is_base_of<_Class, _Argval>::value,
2610 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2611 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2620 template<
typename _Tp,
typename _Up = __remove_cvref_t<_Tp>>
2626 template<
typename _Tp,
typename _Up>
2627 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2632 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2633 struct __result_of_impl
2635 using type = __failure_type;
2638 template<
typename _MemPtr,
typename _Arg>
2639 struct __result_of_impl<true, false, _MemPtr, _Arg>
2640 :
public __result_of_memobj<__decay_t<_MemPtr>,
2641 typename __inv_unwrap<_Arg>::type>
2644 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2645 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2646 :
public __result_of_memfun<__decay_t<_MemPtr>,
2647 typename __inv_unwrap<_Arg>::type, _Args...>
2651 struct __result_of_other_impl
2653 template<
typename _Fn,
typename... _Args>
2654 static __result_of_success<
decltype(
2655 std::declval<_Fn>()(std::declval<_Args>()...)
2656 ), __invoke_other> _S_test(
int);
2658 template<
typename...>
2659 static __failure_type _S_test(...);
2662 template<
typename _Functor,
typename... _ArgTypes>
2663 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2664 :
private __result_of_other_impl
2666 using type =
decltype(_S_test<_Functor, _ArgTypes...>(0));
2670 template<
typename _Functor,
typename... _ArgTypes>
2671 struct __invoke_result
2672 :
public __result_of_impl<
2673 is_member_object_pointer<
2674 typename remove_reference<_Functor>::type
2676 is_member_function_pointer<
2677 typename remove_reference<_Functor>::type
2679 _Functor, _ArgTypes...
2684 template<
typename _Fn,
typename... _Args>
2685 using __invoke_result_t =
typename __invoke_result<_Fn, _Args...>::type;
2688 template<
typename _Functor,
typename... _ArgTypes>
2689 struct result_of<_Functor(_ArgTypes...)>
2690 :
public __invoke_result<_Functor, _ArgTypes...>
2691 { } _GLIBCXX17_DEPRECATED_SUGGEST(
"std::invoke_result");
2693#if __cplusplus >= 201402L
2694#pragma GCC diagnostic push
2695#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
2697 template<
size_t _Len,
size_t _Align =
2698 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2701 template <
size_t _Len,
typename... _Types>
2702 using aligned_union_t _GLIBCXX23_DEPRECATED =
typename aligned_union<_Len, _Types...>::type;
2703#pragma GCC diagnostic pop
2706 template<
typename _Tp>
2710 template<
bool _Cond,
typename _Tp =
void>
2714 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2718 template<
typename... _Tp>
2722 template<
typename _Tp>
2726 template<
typename _Tp>
2730#ifdef __cpp_lib_void_t
2732 template<typename...> using void_t = void;
2742 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2743 struct __detected_or
2750 template<
typename _Def,
template<
typename...>
class _Op,
typename... _Args>
2751 requires requires {
typename _Op<_Args...>; }
2752 struct __detected_or<_Def, _Op, _Args...>
2754 using type = _Op<_Args...>;
2759 template<
typename _Default,
typename _AlwaysVoid,
2760 template<
typename...>
class _Op,
typename... _Args>
2763 using type = _Default;
2768 template<
typename _Default,
template<
typename...>
class _Op,
2770 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2772 using type = _Op<_Args...>;
2776 template<
typename _Default,
template<
typename...>
class _Op,
2778 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2782 template<
typename _Default,
template<
typename...>
class _Op,
2784 using __detected_or_t
2785 =
typename __detected_or<_Default, _Op, _Args...>::type;
2791#define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2792 template<typename _Tp, typename = __void_t<>> \
2793 struct __has_##_NTYPE \
2796 template<typename _Tp> \
2797 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \
2801 template <
typename _Tp>
2802 struct __is_swappable;
2804 template <
typename _Tp>
2805 struct __is_nothrow_swappable;
2812 template<
typename _Tp>
2813 struct __is_tuple_like
2814 :
public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type
2818 template<
typename _Tp>
2819 _GLIBCXX20_CONSTEXPR
2821 _Require<__not_<__is_tuple_like<_Tp>>,
2822 is_move_constructible<_Tp>,
2823 is_move_assignable<_Tp>>
2825 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2826 is_nothrow_move_assignable<_Tp>>::value);
2828 template<
typename _Tp,
size_t _Nm>
2829 _GLIBCXX20_CONSTEXPR
2831 __enable_if_t<__is_swappable<_Tp>::value>
2832 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2833 noexcept(__is_nothrow_swappable<_Tp>::value);
2836 namespace __swappable_details {
2839 struct __do_is_swappable_impl
2841 template<
typename _Tp,
typename
2842 =
decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2849 struct __do_is_nothrow_swappable_impl
2851 template<
typename _Tp>
2852 static __bool_constant<
2853 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2862 template<
typename _Tp>
2863 struct __is_swappable_impl
2864 :
public __swappable_details::__do_is_swappable_impl
2866 using type =
decltype(__test<_Tp>(0));
2869 template<
typename _Tp>
2870 struct __is_nothrow_swappable_impl
2871 :
public __swappable_details::__do_is_nothrow_swappable_impl
2873 using type =
decltype(__test<_Tp>(0));
2876 template<
typename _Tp>
2877 struct __is_swappable
2878 :
public __is_swappable_impl<_Tp>::type
2881 template<
typename _Tp>
2882 struct __is_nothrow_swappable
2883 :
public __is_nothrow_swappable_impl<_Tp>::type
2887#ifdef __cpp_lib_is_swappable
2891 template<
typename _Tp>
2893 :
public __is_swappable_impl<_Tp>::type
2895 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2896 "template argument must be a complete class or an unbounded array");
2900 template<
typename _Tp>
2901 struct is_nothrow_swappable
2902 :
public __is_nothrow_swappable_impl<_Tp>::type
2904 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2905 "template argument must be a complete class or an unbounded array");
2908#if __cplusplus >= 201402L
2910 template<
typename _Tp>
2911 _GLIBCXX17_INLINE
constexpr bool is_swappable_v =
2912 is_swappable<_Tp>::value;
2915 template<
typename _Tp>
2916 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_v =
2917 is_nothrow_swappable<_Tp>::value;
2921 namespace __swappable_with_details {
2924 struct __do_is_swappable_with_impl
2926 template<
typename _Tp,
typename _Up,
typename
2927 =
decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2929 =
decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2932 template<
typename,
typename>
2936 struct __do_is_nothrow_swappable_with_impl
2938 template<
typename _Tp,
typename _Up>
2939 static __bool_constant<
2940 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2942 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2945 template<
typename,
typename>
2951 template<
typename _Tp,
typename _Up>
2952 struct __is_swappable_with_impl
2953 :
public __swappable_with_details::__do_is_swappable_with_impl
2955 using type =
decltype(__test<_Tp, _Up>(0));
2959 template<
typename _Tp>
2960 struct __is_swappable_with_impl<_Tp&, _Tp&>
2961 :
public __swappable_details::__do_is_swappable_impl
2963 using type =
decltype(__test<_Tp&>(0));
2966 template<
typename _Tp,
typename _Up>
2967 struct __is_nothrow_swappable_with_impl
2968 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2970 using type =
decltype(__test<_Tp, _Up>(0));
2974 template<
typename _Tp>
2975 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2976 :
public __swappable_details::__do_is_nothrow_swappable_impl
2978 using type =
decltype(__test<_Tp&>(0));
2983 template<
typename _Tp,
typename _Up>
2984 struct is_swappable_with
2985 :
public __is_swappable_with_impl<_Tp, _Up>::type
2987 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2988 "first template argument must be a complete class or an unbounded array");
2989 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
2990 "second template argument must be a complete class or an unbounded array");
2994 template<
typename _Tp,
typename _Up>
2995 struct is_nothrow_swappable_with
2996 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2998 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
2999 "first template argument must be a complete class or an unbounded array");
3000 static_assert(std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3001 "second template argument must be a complete class or an unbounded array");
3004#if __cplusplus >= 201402L
3006 template<
typename _Tp,
typename _Up>
3007 _GLIBCXX17_INLINE
constexpr bool is_swappable_with_v =
3008 is_swappable_with<_Tp, _Up>::value;
3011 template<
typename _Tp,
typename _Up>
3012 _GLIBCXX17_INLINE
constexpr bool is_nothrow_swappable_with_v =
3013 is_nothrow_swappable_with<_Tp, _Up>::value;
3023 template<
typename _Result,
typename _Ret,
3024 bool = is_void<_Ret>::value,
typename =
void>
3025 struct __is_invocable_impl
3032 template<
typename _Result,
typename _Ret>
3033 struct __is_invocable_impl<_Result, _Ret,
3035 __void_t<typename _Result::type>>
3041#pragma GCC diagnostic push
3042#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3044 template<
typename _Result,
typename _Ret>
3045 struct __is_invocable_impl<_Result, _Ret,
3047 __void_t<typename _Result::type>>
3051 using _Res_t =
typename _Result::type;
3055 static _Res_t _S_get() noexcept;
3058 template<typename _Tp>
3059 static
void _S_conv(__type_identity_t<_Tp>) noexcept;
3062 template<typename _Tp,
3063 bool _Nothrow = noexcept(_S_conv<_Tp>(_S_get())),
3064 typename = decltype(_S_conv<_Tp>(_S_get())),
3065#if __has_builtin(__reference_converts_from_temporary)
3066 bool _Dangle = __reference_converts_from_temporary(_Tp, _Res_t)
3068 bool _Dangle =
false
3071 static __bool_constant<_Nothrow && !_Dangle>
3074 template<
typename _Tp,
bool = false>
3080 using type =
decltype(_S_test<_Ret,
true>(1));
3083 using __nothrow_conv =
decltype(_S_test<_Ret>(1));
3085#pragma GCC diagnostic pop
3087 template<
typename _Fn,
typename... _ArgTypes>
3088 struct __is_invocable
3089 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3092 template<
typename _Fn,
typename _Tp,
typename... _Args>
3093 constexpr bool __call_is_nt(__invoke_memfun_ref)
3095 using _Up =
typename __inv_unwrap<_Tp>::type;
3096 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
3097 std::declval<_Args>()...));
3100 template<
typename _Fn,
typename _Tp,
typename... _Args>
3101 constexpr bool __call_is_nt(__invoke_memfun_deref)
3103 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
3104 std::declval<_Args>()...));
3107 template<
typename _Fn,
typename _Tp>
3108 constexpr bool __call_is_nt(__invoke_memobj_ref)
3110 using _Up =
typename __inv_unwrap<_Tp>::type;
3111 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
3114 template<
typename _Fn,
typename _Tp>
3115 constexpr bool __call_is_nt(__invoke_memobj_deref)
3117 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
3120 template<
typename _Fn,
typename... _Args>
3121 constexpr bool __call_is_nt(__invoke_other)
3123 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
3126 template<
typename _Result,
typename _Fn,
typename... _Args>
3127 struct __call_is_nothrow
3129 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
3133 template<
typename _Fn,
typename... _Args>
3134 using __call_is_nothrow_
3135 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
3138 template<
typename _Fn,
typename... _Args>
3139 struct __is_nothrow_invocable
3140 : __and_<__is_invocable<_Fn, _Args...>,
3141 __call_is_nothrow_<_Fn, _Args...>>::type
3144#pragma GCC diagnostic push
3145#pragma GCC diagnostic ignored "-Wctor-dtor-privacy"
3146 struct __nonesuchbase {};
3147 struct __nonesuch :
private __nonesuchbase {
3148 ~__nonesuch() =
delete;
3149 __nonesuch(__nonesuch
const&) =
delete;
3150 void operator=(__nonesuch
const&) =
delete;
3152#pragma GCC diagnostic pop
3155#ifdef __cpp_lib_is_invocable
3157 template<typename _Functor, typename... _ArgTypes>
3158 struct invoke_result
3159 :
public __invoke_result<_Functor, _ArgTypes...>
3161 static_assert(std::__is_complete_or_unbounded(__type_identity<_Functor>{}),
3162 "_Functor must be a complete class or an unbounded array");
3163 static_assert((std::__is_complete_or_unbounded(
3164 __type_identity<_ArgTypes>{}) && ...),
3165 "each argument type must be a complete class or an unbounded array");
3169 template<
typename _Fn,
typename... _Args>
3170 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
3173 template<
typename _Fn,
typename... _ArgTypes>
3175 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
3177 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3178 "_Fn must be a complete class or an unbounded array");
3179 static_assert((std::__is_complete_or_unbounded(
3180 __type_identity<_ArgTypes>{}) && ...),
3181 "each argument type must be a complete class or an unbounded array");
3185 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3186 struct is_invocable_r
3187 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
3189 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3190 "_Fn must be a complete class or an unbounded array");
3191 static_assert((std::__is_complete_or_unbounded(
3192 __type_identity<_ArgTypes>{}) && ...),
3193 "each argument type must be a complete class or an unbounded array");
3194 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3195 "_Ret must be a complete class or an unbounded array");
3199 template<
typename _Fn,
typename... _ArgTypes>
3200 struct is_nothrow_invocable
3201 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
3202 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3204 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3205 "_Fn must be a complete class or an unbounded array");
3206 static_assert((std::__is_complete_or_unbounded(
3207 __type_identity<_ArgTypes>{}) && ...),
3208 "each argument type must be a complete class or an unbounded array");
3215 template<
typename _Result,
typename _Ret>
3216 using __is_nt_invocable_impl
3217 =
typename __is_invocable_impl<_Result, _Ret>::__nothrow_conv;
3221 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
3222 struct is_nothrow_invocable_r
3223 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
3224 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
3226 static_assert(std::__is_complete_or_unbounded(__type_identity<_Fn>{}),
3227 "_Fn must be a complete class or an unbounded array");
3228 static_assert((std::__is_complete_or_unbounded(
3229 __type_identity<_ArgTypes>{}) && ...),
3230 "each argument type must be a complete class or an unbounded array");
3231 static_assert(std::__is_complete_or_unbounded(__type_identity<_Ret>{}),
3232 "_Ret must be a complete class or an unbounded array");
3236#if __cpp_lib_type_trait_variable_templates
3251template <
typename _Tp>
3252 inline constexpr bool is_void_v = is_void<_Tp>::value;
3253template <
typename _Tp>
3254 inline constexpr bool is_null_pointer_v = is_null_pointer<_Tp>::value;
3255template <
typename _Tp>
3256 inline constexpr bool is_integral_v = is_integral<_Tp>::value;
3257template <
typename _Tp>
3258 inline constexpr bool is_floating_point_v = is_floating_point<_Tp>::value;
3260#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_array)
3261template <
typename _Tp>
3262 inline constexpr bool is_array_v = __is_array(_Tp);
3264template <
typename _Tp>
3265 inline constexpr bool is_array_v =
false;
3266template <
typename _Tp>
3267 inline constexpr bool is_array_v<_Tp[]> =
true;
3268template <
typename _Tp,
size_t _Num>
3269 inline constexpr bool is_array_v<_Tp[_Num]> =
true;
3272template <
typename _Tp>
3273 inline constexpr bool is_pointer_v = is_pointer<_Tp>::value;
3274template <
typename _Tp>
3275 inline constexpr bool is_lvalue_reference_v =
false;
3276template <
typename _Tp>
3277 inline constexpr bool is_lvalue_reference_v<_Tp&> =
true;
3278template <
typename _Tp>
3279 inline constexpr bool is_rvalue_reference_v =
false;
3280template <
typename _Tp>
3281 inline constexpr bool is_rvalue_reference_v<_Tp&&> =
true;
3283#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_object_pointer)
3284template <
typename _Tp>
3285 inline constexpr bool is_member_object_pointer_v =
3286 __is_member_object_pointer(_Tp);
3288template <
typename _Tp>
3289 inline constexpr bool is_member_object_pointer_v =
3290 is_member_object_pointer<_Tp>::value;
3293#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_function_pointer)
3294template <
typename _Tp>
3295 inline constexpr bool is_member_function_pointer_v =
3296 __is_member_function_pointer(_Tp);
3298template <
typename _Tp>
3299 inline constexpr bool is_member_function_pointer_v =
3300 is_member_function_pointer<_Tp>::value;
3303template <
typename _Tp>
3304 inline constexpr bool is_enum_v = __is_enum(_Tp);
3305template <
typename _Tp>
3306 inline constexpr bool is_union_v = __is_union(_Tp);
3307template <
typename _Tp>
3308 inline constexpr bool is_class_v = __is_class(_Tp);
3311#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_reference)
3312template <
typename _Tp>
3313 inline constexpr bool is_reference_v = __is_reference(_Tp);
3315template <
typename _Tp>
3316 inline constexpr bool is_reference_v =
false;
3317template <
typename _Tp>
3318 inline constexpr bool is_reference_v<_Tp&> =
true;
3319template <
typename _Tp>
3320 inline constexpr bool is_reference_v<_Tp&&> =
true;
3323template <
typename _Tp>
3324 inline constexpr bool is_arithmetic_v = is_arithmetic<_Tp>::value;
3325template <
typename _Tp>
3326 inline constexpr bool is_fundamental_v = is_fundamental<_Tp>::value;
3328#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_object)
3329template <
typename _Tp>
3330 inline constexpr bool is_object_v = __is_object(_Tp);
3332template <
typename _Tp>
3333 inline constexpr bool is_object_v = is_object<_Tp>::value;
3336template <
typename _Tp>
3337 inline constexpr bool is_scalar_v = is_scalar<_Tp>::value;
3338template <
typename _Tp>
3339 inline constexpr bool is_compound_v = !is_fundamental_v<_Tp>;
3341#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_member_pointer)
3342template <
typename _Tp>
3343 inline constexpr bool is_member_pointer_v = __is_member_pointer(_Tp);
3345template <
typename _Tp>
3346 inline constexpr bool is_member_pointer_v = is_member_pointer<_Tp>::value;
3349template <
typename _Tp>
3350 inline constexpr bool is_const_v =
false;
3351template <
typename _Tp>
3352 inline constexpr bool is_const_v<const _Tp> =
true;
3354#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_function)
3355template <
typename _Tp>
3356 inline constexpr bool is_function_v = __is_function(_Tp);
3358template <
typename _Tp>
3359 inline constexpr bool is_function_v = !is_const_v<const _Tp>;
3360template <
typename _Tp>
3361 inline constexpr bool is_function_v<_Tp&> =
false;
3362template <
typename _Tp>
3363 inline constexpr bool is_function_v<_Tp&&> =
false;
3366template <
typename _Tp>
3367 inline constexpr bool is_volatile_v =
false;
3368template <
typename _Tp>
3369 inline constexpr bool is_volatile_v<volatile _Tp> =
true;
3371template <
typename _Tp>
3372 inline constexpr bool is_trivial_v = __is_trivial(_Tp);
3373template <
typename _Tp>
3374 inline constexpr bool is_trivially_copyable_v = __is_trivially_copyable(_Tp);
3375template <
typename _Tp>
3376 inline constexpr bool is_standard_layout_v = __is_standard_layout(_Tp);
3377template <
typename _Tp>
3378 _GLIBCXX20_DEPRECATED_SUGGEST(
"is_standard_layout_v && is_trivial_v")
3379 inline constexpr
bool is_pod_v = __is_pod(_Tp);
3380template <typename _Tp>
3381 _GLIBCXX17_DEPRECATED
3382 inline constexpr
bool is_literal_type_v = __is_literal_type(_Tp);
3383template <typename _Tp>
3384 inline constexpr
bool is_empty_v = __is_empty(_Tp);
3385template <typename _Tp>
3386 inline constexpr
bool is_polymorphic_v = __is_polymorphic(_Tp);
3387template <typename _Tp>
3388 inline constexpr
bool is_abstract_v = __is_abstract(_Tp);
3389template <typename _Tp>
3390 inline constexpr
bool is_final_v = __is_final(_Tp);
3392template <typename _Tp>
3393 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
3394template <typename _Tp>
3395 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
3397template <typename _Tp, typename... _Args>
3398 inline constexpr
bool is_constructible_v = __is_constructible(_Tp, _Args...);
3399template <typename _Tp>
3400 inline constexpr
bool is_default_constructible_v = __is_constructible(_Tp);
3401template <typename _Tp>
3402 inline constexpr
bool is_copy_constructible_v
3403 = __is_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3404template <typename _Tp>
3405 inline constexpr
bool is_move_constructible_v
3406 = __is_constructible(_Tp, __add_rval_ref_t<_Tp>);
3408template <typename _Tp, typename _Up>
3409 inline constexpr
bool is_assignable_v = __is_assignable(_Tp, _Up);
3410template <typename _Tp>
3411 inline constexpr
bool is_copy_assignable_v
3412 = __is_assignable(__add_lval_ref_t<_Tp>, __add_lval_ref_t<const _Tp>);
3413template <typename _Tp>
3414 inline constexpr
bool is_move_assignable_v
3415 = __is_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3417template <typename _Tp>
3418 inline constexpr
bool is_destructible_v = is_destructible<_Tp>::value;
3420template <typename _Tp, typename... _Args>
3421 inline constexpr
bool is_trivially_constructible_v
3422 = __is_trivially_constructible(_Tp, _Args...);
3423template <typename _Tp>
3424 inline constexpr
bool is_trivially_default_constructible_v
3425 = __is_trivially_constructible(_Tp);
3426template <typename _Tp>
3427 inline constexpr
bool is_trivially_copy_constructible_v
3428 = __is_trivially_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3429template <typename _Tp>
3430 inline constexpr
bool is_trivially_move_constructible_v
3431 = __is_trivially_constructible(_Tp, __add_rval_ref_t<_Tp>);
3433template <typename _Tp, typename _Up>
3434 inline constexpr
bool is_trivially_assignable_v
3435 = __is_trivially_assignable(_Tp, _Up);
3436template <typename _Tp>
3437 inline constexpr
bool is_trivially_copy_assignable_v
3438 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3439 __add_lval_ref_t<const _Tp>);
3440template <typename _Tp>
3441 inline constexpr
bool is_trivially_move_assignable_v
3442 = __is_trivially_assignable(__add_lval_ref_t<_Tp>,
3443 __add_rval_ref_t<_Tp>);
3446template <
typename _Tp>
3447 inline constexpr bool is_trivially_destructible_v =
false;
3449template <
typename _Tp>
3450 requires (!is_reference_v<_Tp>) &&
requires (_Tp& __t) { __t.~_Tp(); }
3451 inline constexpr bool is_trivially_destructible_v<_Tp>
3452 = __has_trivial_destructor(_Tp);
3453template <
typename _Tp>
3454 inline constexpr bool is_trivially_destructible_v<_Tp&> =
true;
3455template <
typename _Tp>
3456 inline constexpr bool is_trivially_destructible_v<_Tp&&> =
true;
3457template <
typename _Tp,
size_t _Nm>
3458 inline constexpr bool is_trivially_destructible_v<_Tp[_Nm]>
3459 = is_trivially_destructible_v<_Tp>;
3461template <
typename _Tp>
3462 inline constexpr bool is_trivially_destructible_v =
3463 is_trivially_destructible<_Tp>::value;
3466template <
typename _Tp,
typename... _Args>
3467 inline constexpr bool is_nothrow_constructible_v
3468 = __is_nothrow_constructible(_Tp, _Args...);
3469template <
typename _Tp>
3470 inline constexpr bool is_nothrow_default_constructible_v
3471 = __is_nothrow_constructible(_Tp);
3472template <
typename _Tp>
3473 inline constexpr bool is_nothrow_copy_constructible_v
3474 = __is_nothrow_constructible(_Tp, __add_lval_ref_t<const _Tp>);
3475template <
typename _Tp>
3476 inline constexpr bool is_nothrow_move_constructible_v
3477 = __is_nothrow_constructible(_Tp, __add_rval_ref_t<_Tp>);
3479template <
typename _Tp,
typename _Up>
3480 inline constexpr bool is_nothrow_assignable_v
3481 = __is_nothrow_assignable(_Tp, _Up);
3482template <
typename _Tp>
3483 inline constexpr bool is_nothrow_copy_assignable_v
3484 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>,
3485 __add_lval_ref_t<const _Tp>);
3486template <
typename _Tp>
3487 inline constexpr bool is_nothrow_move_assignable_v
3488 = __is_nothrow_assignable(__add_lval_ref_t<_Tp>, __add_rval_ref_t<_Tp>);
3490template <
typename _Tp>
3491 inline constexpr bool is_nothrow_destructible_v =
3492 is_nothrow_destructible<_Tp>::value;
3494template <
typename _Tp>
3495 inline constexpr bool has_virtual_destructor_v
3496 = __has_virtual_destructor(_Tp);
3498template <
typename _Tp>
3499 inline constexpr size_t alignment_of_v = alignment_of<_Tp>::value;
3501template <
typename _Tp>
3502 inline constexpr size_t rank_v = 0;
3503template <
typename _Tp,
size_t _Size>
3504 inline constexpr size_t rank_v<_Tp[_Size]> = 1 + rank_v<_Tp>;
3505template <
typename _Tp>
3506 inline constexpr size_t rank_v<_Tp[]> = 1 + rank_v<_Tp>;
3508template <
typename _Tp,
unsigned _Idx = 0>
3509 inline constexpr size_t extent_v = 0;
3510template <
typename _Tp,
size_t _Size>
3511 inline constexpr size_t extent_v<_Tp[_Size], 0> = _Size;
3512template <
typename _Tp,
unsigned _Idx,
size_t _Size>
3513 inline constexpr size_t extent_v<_Tp[_Size], _Idx> = extent_v<_Tp, _Idx - 1>;
3514template <
typename _Tp>
3515 inline constexpr size_t extent_v<_Tp[], 0> = 0;
3516template <
typename _Tp,
unsigned _Idx>
3517 inline constexpr size_t extent_v<_Tp[], _Idx> = extent_v<_Tp, _Idx - 1>;
3519#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_same)
3520template <
typename _Tp,
typename _Up>
3521 inline constexpr bool is_same_v = __is_same(_Tp, _Up);
3523template <
typename _Tp,
typename _Up>
3524 inline constexpr bool is_same_v =
false;
3525template <
typename _Tp>
3526 inline constexpr bool is_same_v<_Tp, _Tp> =
true;
3528template <
typename _Base,
typename _Derived>
3529 inline constexpr bool is_base_of_v = __is_base_of(_Base, _Derived);
3530#if _GLIBCXX_USE_BUILTIN_TRAIT(__is_convertible)
3531template <
typename _From,
typename _To>
3532 inline constexpr bool is_convertible_v = __is_convertible(_From, _To);
3534template <
typename _From,
typename _To>
3535 inline constexpr bool is_convertible_v = is_convertible<_From, _To>::value;
3537template<
typename _Fn,
typename... _Args>
3538 inline constexpr bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
3539template<
typename _Fn,
typename... _Args>
3540 inline constexpr bool is_nothrow_invocable_v
3541 = is_nothrow_invocable<_Fn, _Args...>::value;
3542template<
typename _Ret,
typename _Fn,
typename... _Args>
3543 inline constexpr bool is_invocable_r_v
3544 = is_invocable_r<_Ret, _Fn, _Args...>::value;
3545template<
typename _Ret,
typename _Fn,
typename... _Args>
3546 inline constexpr bool is_nothrow_invocable_r_v
3547 = is_nothrow_invocable_r<_Ret, _Fn, _Args...>::value;
3551#ifdef __cpp_lib_has_unique_object_representations
3554 template<typename _Tp>
3555 struct has_unique_object_representations
3556 : bool_constant<__has_unique_object_representations(
3557 remove_cv_t<remove_all_extents_t<_Tp>>
3560 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
3561 "template argument must be a complete class or an unbounded array");
3564# if __cpp_lib_type_trait_variable_templates
3566 template<typename _Tp>
3567 inline constexpr bool has_unique_object_representations_v
3568 = has_unique_object_representations<_Tp>::value;
3572#ifdef __cpp_lib_is_aggregate
3575 template<typename _Tp>
3577 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)>
3580# if __cpp_lib_type_trait_variable_templates
3585 template<
typename _Tp>
3586 inline constexpr bool is_aggregate_v = __is_aggregate(remove_cv_t<_Tp>);
3594#ifdef __cpp_lib_remove_cvref
3595# if _GLIBCXX_USE_BUILTIN_TRAIT(__remove_cvref)
3596 template<
typename _Tp>
3598 {
using type = __remove_cvref(_Tp); };
3600 template<
typename _Tp>
3602 {
using type =
typename remove_cv<_Tp>::type; };
3604 template<
typename _Tp>
3605 struct remove_cvref<_Tp&>
3606 {
using type =
typename remove_cv<_Tp>::type; };
3608 template<
typename _Tp>
3609 struct remove_cvref<_Tp&&>
3610 {
using type =
typename remove_cv<_Tp>::type; };
3613 template<
typename _Tp>
3614 using remove_cvref_t =
typename remove_cvref<_Tp>::type;
3618#ifdef __cpp_lib_type_identity
3623 template<
typename _Tp>
3624 struct type_identity {
using type = _Tp; };
3626 template<
typename _Tp>
3627 using type_identity_t =
typename type_identity<_Tp>::type;
3631#ifdef __cpp_lib_unwrap_ref
3636 template<
typename _Tp>
3637 struct unwrap_reference {
using type = _Tp; };
3639 template<
typename _Tp>
3640 struct unwrap_reference<reference_wrapper<_Tp>> {
using type = _Tp&; };
3642 template<
typename _Tp>
3643 using unwrap_reference_t =
typename unwrap_reference<_Tp>::type;
3650 template<
typename _Tp>
3651 struct unwrap_ref_decay {
using type = unwrap_reference_t<decay_t<_Tp>>; };
3653 template<
typename _Tp>
3654 using unwrap_ref_decay_t =
typename unwrap_ref_decay<_Tp>::type;
3658#ifdef __cpp_lib_bounded_array_traits
3662# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_bounded_array)
3663 template<
typename _Tp>
3664 inline constexpr bool is_bounded_array_v = __is_bounded_array(_Tp);
3666 template<
typename _Tp>
3667 inline constexpr bool is_bounded_array_v =
false;
3669 template<
typename _Tp,
size_t _Size>
3670 inline constexpr bool is_bounded_array_v<_Tp[_Size]> =
true;
3676 template<
typename _Tp>
3677 inline constexpr bool is_unbounded_array_v =
false;
3679 template<
typename _Tp>
3680 inline constexpr bool is_unbounded_array_v<_Tp[]> =
true;
3684 template<
typename _Tp>
3685 struct is_bounded_array
3686 :
public bool_constant<is_bounded_array_v<_Tp>>
3691 template<
typename _Tp>
3692 struct is_unbounded_array
3693 :
public bool_constant<is_unbounded_array_v<_Tp>>
3697#if __has_builtin(__is_layout_compatible) && __cplusplus >= 202002L
3700 template<
typename _Tp,
typename _Up>
3702 : bool_constant<__is_layout_compatible(_Tp, _Up)>
3707 template<
typename _Tp,
typename _Up>
3709 = __is_layout_compatible(_Tp, _Up);
3711#if __has_builtin(__builtin_is_corresponding_member)
3712# ifndef __cpp_lib_is_layout_compatible
3713# error "libstdc++ bug: is_corresponding_member and is_layout_compatible are provided but their FTM is not set"
3717 template<
typename _S1,
typename _S2,
typename _M1,
typename _M2>
3720 {
return __builtin_is_corresponding_member(__m1, __m2); }
3724#if __has_builtin(__is_pointer_interconvertible_base_of) \
3725 && __cplusplus >= 202002L
3728 template<
typename _Base,
typename _Derived>
3730 : bool_constant<__is_pointer_interconvertible_base_of(_Base, _Derived)>
3735 template<
typename _Base,
typename _Derived>
3737 = __is_pointer_interconvertible_base_of(_Base, _Derived);
3739#if __has_builtin(__builtin_is_pointer_interconvertible_with_class)
3740# ifndef __cpp_lib_is_pointer_interconvertible
3741# error "libstdc++ bug: is_pointer_interconvertible available but FTM is not set"
3747 template<
typename _Tp,
typename _Mem>
3750 {
return __builtin_is_pointer_interconvertible_with_class(__mp); }
3754#ifdef __cpp_lib_is_scoped_enum
3758# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3759 template<
typename _Tp>
3760 struct is_scoped_enum
3761 : bool_constant<__is_scoped_enum(_Tp)>
3764 template<
typename _Tp>
3765 struct is_scoped_enum
3769 template<
typename _Tp>
3770 requires __is_enum(_Tp)
3771 &&
requires(remove_cv_t<_Tp> __t) { __t = __t; }
3772 struct is_scoped_enum<_Tp>
3773 : bool_constant<!requires(_Tp __t, void(*__f)(int)) { __f(__t); }>
3779# if _GLIBCXX_USE_BUILTIN_TRAIT(__is_scoped_enum)
3780 template<
typename _Tp>
3781 inline constexpr bool is_scoped_enum_v = __is_scoped_enum(_Tp);
3783 template<
typename _Tp>
3784 inline constexpr bool is_scoped_enum_v = is_scoped_enum<_Tp>::value;
3788#ifdef __cpp_lib_reference_from_temporary
3793 template<typename _Tp, typename _Up>
3794 struct reference_constructs_from_temporary
3795 :
public bool_constant<__reference_constructs_from_temporary(_Tp, _Up)>
3797 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3798 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3799 "template argument must be a complete class or an unbounded array");
3806 template<
typename _Tp,
typename _Up>
3807 struct reference_converts_from_temporary
3808 :
public bool_constant<__reference_converts_from_temporary(_Tp, _Up)>
3810 static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{})
3811 && std::__is_complete_or_unbounded(__type_identity<_Up>{}),
3812 "template argument must be a complete class or an unbounded array");
3817 template<
typename _Tp,
typename _Up>
3818 inline constexpr bool reference_constructs_from_temporary_v
3819 = reference_constructs_from_temporary<_Tp, _Up>::value;
3823 template<
typename _Tp,
typename _Up>
3824 inline constexpr bool reference_converts_from_temporary_v
3825 = reference_converts_from_temporary<_Tp, _Up>::value;
3828#ifdef __cpp_lib_is_constant_evaluated
3831 constexpr inline bool
3832 is_constant_evaluated() noexcept
3834#if __cpp_if_consteval >= 202106L
3835 if consteval {
return true; }
else {
return false; }
3837 return __builtin_is_constant_evaluated();
3842#if __cplusplus >= 202002L
3844 template<
typename _From,
typename _To>
3845 using __copy_cv =
typename __match_cv_qualifiers<_From, _To>::__type;
3847 template<
typename _Xp,
typename _Yp>
3849 =
decltype(
false ? declval<_Xp(&)()>()() :
declval<_Yp(&)()>()());
3851 template<
typename _Ap,
typename _Bp,
typename =
void>
3852 struct __common_ref_impl
3856 template<
typename _Ap,
typename _Bp>
3857 using __common_ref =
typename __common_ref_impl<_Ap, _Bp>::type;
3860 template<
typename _Xp,
typename _Yp>
3861 using __condres_cvref
3862 = __cond_res<__copy_cv<_Xp, _Yp>&, __copy_cv<_Yp, _Xp>&>;
3865 template<
typename _Xp,
typename _Yp>
3866 struct __common_ref_impl<_Xp&, _Yp&, __void_t<__condres_cvref<_Xp, _Yp>>>
3867 : enable_if<is_reference_v<__condres_cvref<_Xp, _Yp>>,
3868 __condres_cvref<_Xp, _Yp>>
3872 template<
typename _Xp,
typename _Yp>
3873 using __common_ref_C = remove_reference_t<__common_ref<_Xp&, _Yp&>>&&;
3876 template<
typename _Xp,
typename _Yp>
3877 struct __common_ref_impl<_Xp&&, _Yp&&,
3878 _Require<is_convertible<_Xp&&, __common_ref_C<_Xp, _Yp>>,
3879 is_convertible<_Yp&&, __common_ref_C<_Xp, _Yp>>>>
3880 {
using type = __common_ref_C<_Xp, _Yp>; };
3883 template<
typename _Xp,
typename _Yp>
3884 using __common_ref_D = __common_ref<const _Xp&, _Yp&>;
3887 template<
typename _Xp,
typename _Yp>
3888 struct __common_ref_impl<_Xp&&, _Yp&,
3889 _Require<is_convertible<_Xp&&, __common_ref_D<_Xp, _Yp>>>>
3890 {
using type = __common_ref_D<_Xp, _Yp>; };
3893 template<
typename _Xp,
typename _Yp>
3894 struct __common_ref_impl<_Xp&, _Yp&&>
3895 : __common_ref_impl<_Yp&&, _Xp&>
3899 template<
typename _Tp,
typename _Up,
3900 template<
typename>
class _TQual,
template<
typename>
class _UQual>
3901 struct basic_common_reference
3905 template<
typename _Tp>
3907 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>; };
3909 template<
typename _Tp>
3911 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&; };
3913 template<
typename _Tp>
3914 struct __xref<_Tp&&>
3915 {
template<
typename _Up>
using __type = __copy_cv<_Tp, _Up>&&; };
3917 template<
typename _Tp1,
typename _Tp2>
3918 using __basic_common_ref
3919 =
typename basic_common_reference<remove_cvref_t<_Tp1>,
3920 remove_cvref_t<_Tp2>,
3921 __xref<_Tp1>::template __type,
3922 __xref<_Tp2>::template __type>::type;
3925 template<
typename... _Tp>
3926 struct common_reference;
3928 template<
typename... _Tp>
3933 struct common_reference<>
3937 template<
typename _Tp0>
3938 struct common_reference<_Tp0>
3939 {
using type = _Tp0; };
3942 template<
typename _Tp1,
typename _Tp2,
int _Bullet = 1,
typename =
void>
3943 struct __common_reference_impl
3944 : __common_reference_impl<_Tp1, _Tp2, _Bullet + 1>
3948 template<
typename _Tp1,
typename _Tp2>
3949 struct common_reference<_Tp1, _Tp2>
3950 : __common_reference_impl<_Tp1, _Tp2>
3954 template<
typename _Tp1,
typename _Tp2>
3955 struct __common_reference_impl<_Tp1&, _Tp2&, 1,
3956 void_t<__common_ref<_Tp1&, _Tp2&>>>
3957 {
using type = __common_ref<_Tp1&, _Tp2&>; };
3959 template<
typename _Tp1,
typename _Tp2>
3960 struct __common_reference_impl<_Tp1&&, _Tp2&&, 1,
3961 void_t<__common_ref<_Tp1&&, _Tp2&&>>>
3962 {
using type = __common_ref<_Tp1&&, _Tp2&&>; };
3964 template<
typename _Tp1,
typename _Tp2>
3965 struct __common_reference_impl<_Tp1&, _Tp2&&, 1,
3966 void_t<__common_ref<_Tp1&, _Tp2&&>>>
3967 {
using type = __common_ref<_Tp1&, _Tp2&&>; };
3969 template<
typename _Tp1,
typename _Tp2>
3970 struct __common_reference_impl<_Tp1&&, _Tp2&, 1,
3971 void_t<__common_ref<_Tp1&&, _Tp2&>>>
3972 {
using type = __common_ref<_Tp1&&, _Tp2&>; };
3975 template<
typename _Tp1,
typename _Tp2>
3976 struct __common_reference_impl<_Tp1, _Tp2, 2,
3977 void_t<__basic_common_ref<_Tp1, _Tp2>>>
3978 {
using type = __basic_common_ref<_Tp1, _Tp2>; };
3981 template<
typename _Tp1,
typename _Tp2>
3982 struct __common_reference_impl<_Tp1, _Tp2, 3,
3983 void_t<__cond_res<_Tp1, _Tp2>>>
3984 {
using type = __cond_res<_Tp1, _Tp2>; };
3987 template<
typename _Tp1,
typename _Tp2>
3988 struct __common_reference_impl<_Tp1, _Tp2, 4,
3990 {
using type = common_type_t<_Tp1, _Tp2>; };
3993 template<
typename _Tp1,
typename _Tp2>
3994 struct __common_reference_impl<_Tp1, _Tp2, 5, void>
3998 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
3999 struct common_reference<_Tp1, _Tp2, _Rest...>
4000 : __common_type_fold<common_reference<_Tp1, _Tp2>,
4001 __common_type_pack<_Rest...>>
4005 template<
typename _Tp1,
typename _Tp2,
typename... _Rest>
4006 struct __common_type_fold<common_reference<_Tp1, _Tp2>,
4007 __common_type_pack<_Rest...>,
4009 :
public common_reference<common_reference_t<_Tp1, _Tp2>, _Rest...>
4017_GLIBCXX_END_NAMESPACE_VERSION
typename common_reference< _Tp... >::type common_reference_t
constexpr bool is_corresponding_member(_M1 _S1::*__m1, _M2 _S2::*__m2) noexcept
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
typename aligned_storage< _S_len, alignment_value >::type type
The storage.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
__bool_constant< false > false_type
The type used as a compile-time boolean with false value.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
typename decay< _Tp >::type decay_t
Alias template for decay.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
constexpr bool is_pointer_interconvertible_with_class(_Mem _Tp::*__mp) noexcept
True if __mp points to the first member of a standard-layout type.
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
constexpr bool is_layout_compatible_v
constexpr bool is_pointer_interconvertible_base_of_v
auto declval() noexcept -> decltype(__declval< _Tp >(0))
void void_t
A metafunction that always yields void, used for detecting valid types.
ISO C++ entities toplevel namespace is std.
GNU extensions for public use.
Define a member typedef type only if a boolean constant is true.
is_member_function_pointer
is_nothrow_default_constructible
is_nothrow_copy_constructible
is_nothrow_move_constructible
is_nothrow_copy_assignable
is_nothrow_move_assignable
is_trivially_constructible
is_trivially_default_constructible
is_trivially_copy_constructible
is_trivially_move_constructible
is_trivially_copy_assignable
is_trivially_move_assignable
is_trivially_destructible
Provide aligned storage for types.
Define a member typedef type to one of two argument types.
The underlying type of an enum.
True if _Derived is standard-layout and has a base class of type _Base