29 #ifndef _GLIBCXX_TYPE_TRAITS 30 #define _GLIBCXX_TYPE_TRAITS 1 32 #pragma GCC system_header 34 #if __cplusplus < 201103L 40 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 41 # if defined (__UINT_LEAST16_TYPE__) && defined(__UINT_LEAST32_TYPE__) 44 typedef __UINT_LEAST16_TYPE__ uint_least16_t;
45 typedef __UINT_LEAST32_TYPE__ uint_least32_t;
52 namespace std _GLIBCXX_VISIBILITY(default)
54 _GLIBCXX_BEGIN_NAMESPACE_VERSION
68 template<
typename _Tp, _Tp __v>
71 static constexpr _Tp value = __v;
72 typedef _Tp value_type;
74 constexpr
operator value_type()
const noexcept {
return value; }
75 #if __cplusplus > 201103L 77 #define __cpp_lib_integral_constant_callable 201304 79 constexpr value_type operator()()
const noexcept {
return value; }
83 template<
typename _Tp, _Tp __v>
95 #if __cplusplus > 201402L 96 # define __cpp_lib_bool_constant 201505 103 template<
bool,
typename,
typename>
106 template<
typename...>
114 template<
typename _B1>
119 template<
typename _B1,
typename _B2>
120 struct __or_<_B1, _B2>
121 :
public conditional<_B1::value, _B1, _B2>::type
124 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
125 struct __or_<_B1, _B2, _B3, _Bn...>
126 :
public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
129 template<
typename...>
137 template<
typename _B1>
142 template<
typename _B1,
typename _B2>
143 struct __and_<_B1, _B2>
144 :
public conditional<_B1::value, _B2, _B1>::type
147 template<
typename _B1,
typename _B2,
typename _B3,
typename... _Bn>
148 struct __and_<_B1, _B2, _B3, _Bn...>
149 :
public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
152 template<
typename _Pp>
154 :
public __bool_constant<!bool(_Pp::value)>
157 #if __cplusplus >= 201703L 159 #define __cpp_lib_logical_traits 201510 161 template<
typename... _Bn>
166 template<
typename... _Bn>
171 template<
typename _Pp>
176 template<
typename... _Bn>
177 inline constexpr
bool conjunction_v = conjunction<_Bn...>::value;
179 template<
typename... _Bn>
180 inline constexpr
bool disjunction_v = disjunction<_Bn...>::value;
182 template<
typename _Pp>
183 inline constexpr
bool negation_v = negation<_Pp>::value;
192 template<
typename _Tp>
193 struct __success_type
194 {
typedef _Tp type; };
196 struct __failure_type
205 struct __is_void_helper
206 :
public false_type { };
209 struct __is_void_helper<void>
210 :
public true_type { };
213 template<
typename _Tp>
215 :
public __is_void_helper<typename remove_cv<_Tp>::type>
::type 219 struct __is_integral_helper
220 :
public false_type { };
223 struct __is_integral_helper<bool>
224 :
public true_type { };
227 struct __is_integral_helper<char>
228 :
public true_type { };
231 struct __is_integral_helper<signed char>
232 :
public true_type { };
235 struct __is_integral_helper<unsigned char>
236 :
public true_type { };
238 #ifdef _GLIBCXX_USE_WCHAR_T 240 struct __is_integral_helper<wchar_t>
241 :
public true_type { };
245 struct __is_integral_helper<char16_t>
246 :
public true_type { };
249 struct __is_integral_helper<char32_t>
250 :
public true_type { };
253 struct __is_integral_helper<short>
254 :
public true_type { };
257 struct __is_integral_helper<unsigned short>
258 :
public true_type { };
261 struct __is_integral_helper<int>
262 :
public true_type { };
265 struct __is_integral_helper<unsigned int>
266 :
public true_type { };
269 struct __is_integral_helper<long>
270 :
public true_type { };
273 struct __is_integral_helper<unsigned long>
274 :
public true_type { };
277 struct __is_integral_helper<long long>
278 :
public true_type { };
281 struct __is_integral_helper<unsigned long long>
282 :
public true_type { };
286 #if defined(__GLIBCXX_TYPE_INT_N_0) 288 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_0>
289 :
public true_type { };
292 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_0>
293 :
public true_type { };
295 #if defined(__GLIBCXX_TYPE_INT_N_1) 297 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_1>
298 :
public true_type { };
301 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_1>
302 :
public true_type { };
304 #if defined(__GLIBCXX_TYPE_INT_N_2) 306 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_2>
307 :
public true_type { };
310 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_2>
311 :
public true_type { };
313 #if defined(__GLIBCXX_TYPE_INT_N_3) 315 struct __is_integral_helper<__GLIBCXX_TYPE_INT_N_3>
316 :
public true_type { };
319 struct __is_integral_helper<unsigned __GLIBCXX_TYPE_INT_N_3>
320 :
public true_type { };
324 template<
typename _Tp>
326 :
public __is_integral_helper<typename remove_cv<_Tp>::type>
::type 330 struct __is_floating_point_helper
331 :
public false_type { };
334 struct __is_floating_point_helper<float>
335 :
public true_type { };
338 struct __is_floating_point_helper<double>
339 :
public true_type { };
342 struct __is_floating_point_helper<long double>
343 :
public true_type { };
345 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128) 347 struct __is_floating_point_helper<__float128>
348 :
public true_type { };
352 template<
typename _Tp>
354 :
public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
360 :
public false_type { };
362 template<
typename _Tp, std::
size_t _Size>
364 :
public true_type { };
366 template<
typename _Tp>
368 :
public true_type { };
371 struct __is_pointer_helper
372 :
public false_type { };
374 template<
typename _Tp>
375 struct __is_pointer_helper<_Tp*>
376 :
public true_type { };
379 template<
typename _Tp>
381 :
public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
387 :
public false_type { };
389 template<
typename _Tp>
391 :
public true_type { };
396 :
public false_type { };
398 template<
typename _Tp>
400 :
public true_type { };
406 struct __is_member_object_pointer_helper
407 :
public false_type { };
409 template<
typename _Tp,
typename _Cp>
410 struct __is_member_object_pointer_helper<_Tp _Cp::*>
414 template<
typename _Tp>
416 :
public __is_member_object_pointer_helper<
417 typename remove_cv<_Tp>::type>::type
421 struct __is_member_function_pointer_helper
422 :
public false_type { };
424 template<
typename _Tp,
typename _Cp>
425 struct __is_member_function_pointer_helper<_Tp _Cp::*>
429 template<
typename _Tp>
431 :
public __is_member_function_pointer_helper<
432 typename remove_cv<_Tp>::type>
::type 436 template<
typename _Tp>
442 template<
typename _Tp>
448 template<
typename _Tp>
456 :
public false_type { };
458 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
459 struct is_function<_Res(_ArgTypes...) _GLIBCXX_NOEXCEPT_QUAL>
460 :
public true_type { };
462 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
463 struct is_function<_Res(_ArgTypes...) & _GLIBCXX_NOEXCEPT_QUAL>
464 :
public true_type { };
466 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
467 struct is_function<_Res(_ArgTypes...) && _GLIBCXX_NOEXCEPT_QUAL>
468 :
public true_type { };
470 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
471 struct is_function<_Res(_ArgTypes......) _GLIBCXX_NOEXCEPT_QUAL>
472 :
public true_type { };
474 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
475 struct is_function<_Res(_ArgTypes......) & _GLIBCXX_NOEXCEPT_QUAL>
476 :
public true_type { };
478 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
479 struct is_function<_Res(_ArgTypes......) && _GLIBCXX_NOEXCEPT_QUAL>
480 :
public true_type { };
482 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
483 struct is_function<_Res(_ArgTypes...) const _GLIBCXX_NOEXCEPT_QUAL>
484 :
public true_type { };
486 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
487 struct is_function<_Res(_ArgTypes...) const & _GLIBCXX_NOEXCEPT_QUAL>
488 :
public true_type { };
490 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
491 struct is_function<_Res(_ArgTypes...) const && _GLIBCXX_NOEXCEPT_QUAL>
492 :
public true_type { };
494 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
495 struct is_function<_Res(_ArgTypes......) const _GLIBCXX_NOEXCEPT_QUAL>
496 :
public true_type { };
498 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
499 struct is_function<_Res(_ArgTypes......) const & _GLIBCXX_NOEXCEPT_QUAL>
500 :
public true_type { };
502 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
503 struct is_function<_Res(_ArgTypes......) const && _GLIBCXX_NOEXCEPT_QUAL>
504 :
public true_type { };
506 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
507 struct is_function<_Res(_ArgTypes...) volatile _GLIBCXX_NOEXCEPT_QUAL>
508 :
public true_type { };
510 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
511 struct is_function<_Res(_ArgTypes...) volatile & _GLIBCXX_NOEXCEPT_QUAL>
512 :
public true_type { };
514 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
515 struct is_function<_Res(_ArgTypes...) volatile && _GLIBCXX_NOEXCEPT_QUAL>
516 :
public true_type { };
518 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
519 struct is_function<_Res(_ArgTypes......) volatile _GLIBCXX_NOEXCEPT_QUAL>
520 :
public true_type { };
522 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
523 struct is_function<_Res(_ArgTypes......) volatile & _GLIBCXX_NOEXCEPT_QUAL>
524 :
public true_type { };
526 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
527 struct is_function<_Res(_ArgTypes......) volatile && _GLIBCXX_NOEXCEPT_QUAL>
528 :
public true_type { };
530 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
531 struct is_function<_Res(_ArgTypes...) const volatile _GLIBCXX_NOEXCEPT_QUAL>
532 :
public true_type { };
534 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
535 struct is_function<_Res(_ArgTypes...) const volatile & _GLIBCXX_NOEXCEPT_QUAL>
536 :
public true_type { };
538 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
539 struct is_function<_Res(_ArgTypes...) const volatile && _GLIBCXX_NOEXCEPT_QUAL>
540 :
public true_type { };
542 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
543 struct is_function<_Res(_ArgTypes......) const volatile _GLIBCXX_NOEXCEPT_QUAL>
544 :
public true_type { };
546 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
547 struct is_function<_Res(_ArgTypes......) const volatile & _GLIBCXX_NOEXCEPT_QUAL>
548 :
public true_type { };
550 template<
typename _Res,
typename... _ArgTypes _GLIBCXX_NOEXCEPT_PARM>
551 struct is_function<_Res(_ArgTypes......) const volatile && _GLIBCXX_NOEXCEPT_QUAL>
552 :
public true_type { };
554 #define __cpp_lib_is_null_pointer 201309 557 struct __is_null_pointer_helper
558 :
public false_type { };
561 struct __is_null_pointer_helper<std::nullptr_t>
562 :
public true_type { };
565 template<
typename _Tp>
567 :
public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
571 template<
typename _Tp>
579 template<
typename _Tp>
581 :
public __or_<is_lvalue_reference<_Tp>,
582 is_rvalue_reference<_Tp>>::type
586 template<
typename _Tp>
588 :
public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
592 template<
typename _Tp>
594 :
public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
595 is_null_pointer<_Tp>>::type
599 template<
typename _Tp>
601 :
public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
609 template<
typename _Tp>
611 :
public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
612 is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
616 template<
typename _Tp>
620 template<
typename _Tp>
621 struct __is_member_pointer_helper
622 :
public false_type { };
624 template<
typename _Tp,
typename _Cp>
625 struct __is_member_pointer_helper<_Tp _Cp::*>
626 :
public true_type { };
629 template<
typename _Tp>
631 :
public __is_member_pointer_helper<typename remove_cv<_Tp>::type>
::type 636 template<
typename _Tp>
637 struct __is_referenceable
638 :
public __or_<is_object<_Tp>, is_reference<_Tp>>
::type 641 template<
typename _Res,
typename... _Args _GLIBCXX_NOEXCEPT_PARM>
642 struct __is_referenceable<_Res(_Args...) _GLIBCXX_NOEXCEPT_QUAL>
646 template<
typename _Res,
typename... _Args _GLIBCXX_NOEXCEPT_PARM>
647 struct __is_referenceable<_Res(_Args......) _GLIBCXX_NOEXCEPT_QUAL>
656 :
public false_type { };
658 template<
typename _Tp>
660 :
public true_type { };
665 :
public false_type { };
667 template<
typename _Tp>
669 :
public true_type { };
672 template<
typename _Tp>
678 template<
typename _Tp>
679 struct is_trivially_copyable
684 template<
typename _Tp>
691 template<
typename _Tp>
697 template<
typename _Tp>
703 template<
typename _Tp>
709 template<
typename _Tp>
714 #if __cplusplus >= 201402L 715 #define __cpp_lib_is_final 201402L 717 template<
typename _Tp>
724 template<
typename _Tp>
729 template<
typename _Tp,
731 struct __is_signed_helper
732 :
public false_type { };
734 template<
typename _Tp>
735 struct __is_signed_helper<_Tp, true>
740 template<typename _Tp>
742 : public __is_signed_helper<_Tp>::type
746 template<typename _Tp>
748 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>
755 struct add_rvalue_reference;
761 template<typename _Tp>
762 typename add_rvalue_reference<_Tp>::type declval() noexcept;
764 template<typename, unsigned = 0>
768 struct remove_all_extents;
770 template<typename _Tp>
771 struct __is_array_known_bounds
772 : public integral_constant<bool, (extent<_Tp>::value > 0)>
775 template<
typename _Tp>
776 struct __is_array_unknown_bounds
777 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
785 struct __do_is_destructible_impl
787 template<
typename _Tp,
typename = decltype(declval<_Tp&>().~_Tp())>
788 static true_type __test(
int);
791 static false_type __test(...);
794 template<
typename _Tp>
795 struct __is_destructible_impl
796 :
public __do_is_destructible_impl
798 typedef decltype(__test<_Tp>(0))
type;
801 template<
typename _Tp,
802 bool = __or_<is_void<_Tp>,
803 __is_array_unknown_bounds<_Tp>,
806 struct __is_destructible_safe;
808 template<
typename _Tp>
809 struct __is_destructible_safe<_Tp, false, false>
810 :
public __is_destructible_impl<typename
811 remove_all_extents<_Tp>::type>
::type 814 template<
typename _Tp>
815 struct __is_destructible_safe<_Tp, true, false>
816 :
public false_type { };
818 template<
typename _Tp>
819 struct __is_destructible_safe<_Tp, false, true>
820 :
public true_type { };
823 template<
typename _Tp>
824 struct is_destructible
825 :
public __is_destructible_safe<_Tp>
::type 832 struct __do_is_nt_destructible_impl
834 template<
typename _Tp>
839 static false_type __test(...);
842 template<
typename _Tp>
843 struct __is_nt_destructible_impl
844 :
public __do_is_nt_destructible_impl
846 typedef decltype(__test<_Tp>(0))
type;
849 template<
typename _Tp,
850 bool = __or_<is_void<_Tp>,
851 __is_array_unknown_bounds<_Tp>,
854 struct __is_nt_destructible_safe;
856 template<
typename _Tp>
857 struct __is_nt_destructible_safe<_Tp, false, false>
858 :
public __is_nt_destructible_impl<typename
859 remove_all_extents<_Tp>::type>
::type 862 template<
typename _Tp>
863 struct __is_nt_destructible_safe<_Tp, true, false>
864 :
public false_type { };
866 template<
typename _Tp>
867 struct __is_nt_destructible_safe<_Tp, false, true>
868 :
public true_type { };
871 template<
typename _Tp>
872 struct is_nothrow_destructible
873 :
public __is_nt_destructible_safe<_Tp>
::type 876 struct __do_is_default_constructible_impl
878 template<
typename _Tp,
typename = decltype(_Tp())>
879 static true_type __test(
int);
882 static false_type __test(...);
885 template<
typename _Tp>
886 struct __is_default_constructible_impl
887 :
public __do_is_default_constructible_impl
889 typedef decltype(__test<_Tp>(0))
type;
892 template<
typename _Tp>
893 struct __is_default_constructible_atom
894 :
public __and_<__not_<is_void<_Tp>>,
895 __is_default_constructible_impl<_Tp>>
898 template<typename _Tp, bool = is_array<_Tp>::value>
899 struct __is_default_constructible_safe;
906 template<
typename _Tp>
907 struct __is_default_constructible_safe<_Tp, true>
908 :
public __and_<__is_array_known_bounds<_Tp>,
909 __is_default_constructible_atom<typename
910 remove_all_extents<_Tp>::type>>
913 template<
typename _Tp>
914 struct __is_default_constructible_safe<_Tp, false>
915 :
public __is_default_constructible_atom<_Tp>
::type 919 template<
typename _Tp>
920 struct is_default_constructible
921 :
public __is_default_constructible_safe<_Tp>
::type 936 struct __do_is_static_castable_impl
938 template<
typename _From,
typename _To,
typename 939 = decltype(static_cast<_To>(declval<_From>()))>
940 static true_type __test(
int);
942 template<
typename,
typename>
943 static false_type __test(...);
946 template<
typename _From,
typename _To>
947 struct __is_static_castable_impl
948 :
public __do_is_static_castable_impl
950 typedef decltype(__test<_From, _To>(0))
type;
953 template<
typename _From,
typename _To>
954 struct __is_static_castable_safe
955 :
public __is_static_castable_impl<_From, _To>
::type 959 template<
typename _From,
typename _To>
960 struct __is_static_castable
970 struct __do_is_direct_constructible_impl
972 template<
typename _Tp,
typename _Arg,
typename 973 = decltype(::
new _Tp(declval<_Arg>()))>
974 static true_type __test(
int);
976 template<
typename,
typename>
977 static false_type __test(...);
980 template<
typename _Tp,
typename _Arg>
981 struct __is_direct_constructible_impl
982 :
public __do_is_direct_constructible_impl
984 typedef decltype(__test<_Tp, _Arg>(0))
type;
987 template<
typename _Tp,
typename _Arg>
988 struct __is_direct_constructible_new_safe
989 :
public __and_<is_destructible<_Tp>,
990 __is_direct_constructible_impl<_Tp, _Arg>>
993 template<
typename,
typename>
996 template<
typename,
typename>
1000 struct remove_reference;
1002 template<
typename _From,
typename _To,
bool 1003 = __not_<__or_<is_void<_From>,
1005 struct __is_base_to_derived_ref;
1007 template<
typename _Tp,
typename... _Args>
1008 struct is_constructible;
1012 template<
typename _From,
typename _To>
1013 struct __is_base_to_derived_ref<_From, _To, true>
1015 typedef typename remove_cv<
typename remove_reference<_From
1017 typedef typename remove_cv<
typename remove_reference<_To
1019 typedef __and_<__not_<is_same<__src_t, __dst_t>>,
1020 is_base_of<__src_t, __dst_t>,
1021 __not_<is_constructible<__dst_t, _From>>>
type;
1022 static constexpr
bool value = type::value;
1025 template<
typename _From,
typename _To>
1026 struct __is_base_to_derived_ref<_From, _To, false>
1030 template<
typename _From,
typename _To,
bool 1031 = __and_<is_lvalue_reference<_From>,
1033 struct __is_lvalue_to_rvalue_ref;
1037 template<
typename _From,
typename _To>
1038 struct __is_lvalue_to_rvalue_ref<_From, _To, true>
1040 typedef typename remove_cv<
typename remove_reference<
1042 typedef typename remove_cv<
typename remove_reference<
1044 typedef __and_<__not_<is_function<__src_t>>,
1045 __or_<is_same<__src_t, __dst_t>,
1046 is_base_of<__dst_t, __src_t>>>
type;
1047 static constexpr
bool value = type::value;
1050 template<
typename _From,
typename _To>
1051 struct __is_lvalue_to_rvalue_ref<_From, _To, false>
1061 template<
typename _Tp,
typename _Arg>
1062 struct __is_direct_constructible_ref_cast
1063 :
public __and_<__is_static_castable<_Arg, _Tp>,
1064 __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
1065 __is_lvalue_to_rvalue_ref<_Arg, _Tp>
1069 template<
typename _Tp,
typename _Arg>
1070 struct __is_direct_constructible_new
1071 :
public conditional<is_reference<_Tp>::value,
1072 __is_direct_constructible_ref_cast<_Tp, _Arg>,
1073 __is_direct_constructible_new_safe<_Tp, _Arg>
1077 template<
typename _Tp,
typename _Arg>
1078 struct __is_direct_constructible
1079 :
public __is_direct_constructible_new<_Tp, _Arg>
::type 1087 struct __do_is_nary_constructible_impl
1089 template<
typename _Tp,
typename... _Args,
typename 1090 = decltype(_Tp(declval<_Args>()...))>
1091 static true_type __test(
int);
1093 template<
typename,
typename...>
1094 static false_type __test(...);
1097 template<
typename _Tp,
typename... _Args>
1098 struct __is_nary_constructible_impl
1099 :
public __do_is_nary_constructible_impl
1101 typedef decltype(__test<_Tp, _Args...>(0))
type;
1104 template<
typename _Tp,
typename... _Args>
1105 struct __is_nary_constructible
1106 :
public __is_nary_constructible_impl<_Tp, _Args...>
::type 1108 static_assert(
sizeof...(_Args) > 1,
1109 "Only useful for > 1 arguments");
1112 template<
typename _Tp,
typename... _Args>
1113 struct __is_constructible_impl
1114 :
public __is_nary_constructible<_Tp, _Args...>
1117 template<
typename _Tp,
typename _Arg>
1118 struct __is_constructible_impl<_Tp, _Arg>
1119 :
public __is_direct_constructible<_Tp, _Arg>
1122 template<
typename _Tp>
1123 struct __is_constructible_impl<_Tp>
1124 :
public is_default_constructible<_Tp>
1128 template<
typename _Tp,
typename... _Args>
1129 struct is_constructible
1130 :
public __is_constructible_impl<_Tp, _Args...>
::type 1133 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1134 struct __is_copy_constructible_impl;
1136 template<
typename _Tp>
1137 struct __is_copy_constructible_impl<_Tp, false>
1138 :
public false_type { };
1140 template<
typename _Tp>
1141 struct __is_copy_constructible_impl<_Tp, true>
1142 :
public is_constructible<_Tp, const _Tp&>
1146 template<
typename _Tp>
1147 struct is_copy_constructible
1148 :
public __is_copy_constructible_impl<_Tp>
1151 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1152 struct __is_move_constructible_impl;
1154 template<
typename _Tp>
1155 struct __is_move_constructible_impl<_Tp, false>
1156 :
public false_type { };
1158 template<
typename _Tp>
1159 struct __is_move_constructible_impl<_Tp, true>
1160 :
public is_constructible<_Tp, _Tp&&>
1164 template<
typename _Tp>
1165 struct is_move_constructible
1166 :
public __is_move_constructible_impl<_Tp>
1169 template<
typename _Tp>
1170 struct __is_nt_default_constructible_atom
1174 template<typename _Tp, bool = is_array<_Tp>::value>
1175 struct __is_nt_default_constructible_impl;
1177 template<
typename _Tp>
1178 struct __is_nt_default_constructible_impl<_Tp, true>
1179 :
public __and_<__is_array_known_bounds<_Tp>,
1180 __is_nt_default_constructible_atom<typename
1181 remove_all_extents<_Tp>::type>>
1184 template<
typename _Tp>
1185 struct __is_nt_default_constructible_impl<_Tp, false>
1186 :
public __is_nt_default_constructible_atom<_Tp>
1190 template<
typename _Tp>
1191 struct is_nothrow_default_constructible
1192 :
public __and_<is_default_constructible<_Tp>,
1193 __is_nt_default_constructible_impl<_Tp>>
1196 template<
typename _Tp,
typename... _Args>
1197 struct __is_nt_constructible_impl
1201 template<
typename _Tp,
typename _Arg>
1202 struct __is_nt_constructible_impl<_Tp, _Arg>
1204 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1207 template<
typename _Tp>
1208 struct __is_nt_constructible_impl<_Tp>
1209 :
public is_nothrow_default_constructible<_Tp>
1213 template<
typename _Tp,
typename... _Args>
1214 struct is_nothrow_constructible
1215 :
public __and_<is_constructible<_Tp, _Args...>,
1216 __is_nt_constructible_impl<_Tp, _Args...>>
1219 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1220 struct __is_nothrow_copy_constructible_impl;
1222 template<
typename _Tp>
1223 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1224 :
public false_type { };
1226 template<
typename _Tp>
1227 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1228 :
public is_nothrow_constructible<_Tp, const _Tp&>
1232 template<
typename _Tp>
1233 struct is_nothrow_copy_constructible
1234 :
public __is_nothrow_copy_constructible_impl<_Tp>
1237 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1238 struct __is_nothrow_move_constructible_impl;
1240 template<
typename _Tp>
1241 struct __is_nothrow_move_constructible_impl<_Tp, false>
1242 :
public false_type { };
1244 template<
typename _Tp>
1245 struct __is_nothrow_move_constructible_impl<_Tp, true>
1246 :
public is_nothrow_constructible<_Tp, _Tp&&>
1250 template<
typename _Tp>
1251 struct is_nothrow_move_constructible
1252 :
public __is_nothrow_move_constructible_impl<_Tp>
1255 template<
typename _Tp,
typename _Up>
1256 class __is_assignable_helper
1258 template<
typename _Tp1,
typename _Up1,
1259 typename = decltype(declval<_Tp1>() = declval<_Up1>())>
1263 template<
typename,
typename>
1268 typedef decltype(__test<_Tp, _Up>(0))
type;
1272 template<
typename _Tp,
typename _Up>
1273 struct is_assignable
1274 :
public __is_assignable_helper<_Tp, _Up>
::type 1277 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1278 struct __is_copy_assignable_impl;
1280 template<
typename _Tp>
1281 struct __is_copy_assignable_impl<_Tp, false>
1282 :
public false_type { };
1284 template<
typename _Tp>
1285 struct __is_copy_assignable_impl<_Tp, true>
1286 :
public is_assignable<_Tp&, const _Tp&>
1290 template<
typename _Tp>
1291 struct is_copy_assignable
1292 :
public __is_copy_assignable_impl<_Tp>
1295 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1296 struct __is_move_assignable_impl;
1298 template<
typename _Tp>
1299 struct __is_move_assignable_impl<_Tp, false>
1300 :
public false_type { };
1302 template<
typename _Tp>
1303 struct __is_move_assignable_impl<_Tp, true>
1304 :
public is_assignable<_Tp&, _Tp&&>
1308 template<
typename _Tp>
1309 struct is_move_assignable
1310 :
public __is_move_assignable_impl<_Tp>
1313 template<
typename _Tp,
typename _Up>
1314 struct __is_nt_assignable_impl
1319 template<
typename _Tp,
typename _Up>
1320 struct is_nothrow_assignable
1321 :
public __and_<is_assignable<_Tp, _Up>,
1322 __is_nt_assignable_impl<_Tp, _Up>>
1325 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1326 struct __is_nt_copy_assignable_impl;
1328 template<
typename _Tp>
1329 struct __is_nt_copy_assignable_impl<_Tp, false>
1330 :
public false_type { };
1332 template<
typename _Tp>
1333 struct __is_nt_copy_assignable_impl<_Tp, true>
1334 :
public is_nothrow_assignable<_Tp&, const _Tp&>
1338 template<
typename _Tp>
1339 struct is_nothrow_copy_assignable
1340 :
public __is_nt_copy_assignable_impl<_Tp>
1343 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1344 struct __is_nt_move_assignable_impl;
1346 template<
typename _Tp>
1347 struct __is_nt_move_assignable_impl<_Tp, false>
1348 :
public false_type { };
1350 template<
typename _Tp>
1351 struct __is_nt_move_assignable_impl<_Tp, true>
1352 :
public is_nothrow_assignable<_Tp&, _Tp&&>
1356 template<
typename _Tp>
1357 struct is_nothrow_move_assignable
1358 :
public __is_nt_move_assignable_impl<_Tp>
1362 template<
typename _Tp,
typename... _Args>
1363 struct is_trivially_constructible
1364 :
public __and_<is_constructible<_Tp, _Args...>, integral_constant<bool,
1365 __is_trivially_constructible(_Tp, _Args...)>>
1369 template<
typename _Tp>
1370 struct is_trivially_default_constructible
1371 :
public is_trivially_constructible<_Tp>
::type 1374 struct __do_is_implicitly_default_constructible_impl
1376 template <
typename _Tp>
1377 static void __helper(
const _Tp&);
1379 template <
typename _Tp>
1380 static true_type __test(
const _Tp&,
1381 decltype(__helper<const _Tp&>({}))* = 0);
1383 static false_type __test(...);
1386 template<
typename _Tp>
1387 struct __is_implicitly_default_constructible_impl
1388 :
public __do_is_implicitly_default_constructible_impl
1390 typedef decltype(__test(declval<_Tp>()))
type;
1393 template<
typename _Tp>
1394 struct __is_implicitly_default_constructible_safe
1395 :
public __is_implicitly_default_constructible_impl<_Tp>
::type 1398 template <
typename _Tp>
1399 struct __is_implicitly_default_constructible
1400 :
public __and_<is_default_constructible<_Tp>,
1401 __is_implicitly_default_constructible_safe<_Tp>>
1405 template<
typename _Tp>
1406 struct is_trivially_copy_constructible
1407 :
public __and_<is_copy_constructible<_Tp>,
1408 integral_constant<bool,
1409 __is_trivially_constructible(_Tp, const _Tp&)>>
1413 template<
typename _Tp>
1414 struct is_trivially_move_constructible
1415 :
public __and_<is_move_constructible<_Tp>,
1416 integral_constant<bool,
1417 __is_trivially_constructible(_Tp, _Tp&&)>>
1421 template<
typename _Tp,
typename _Up>
1422 struct is_trivially_assignable
1423 :
public __and_<is_assignable<_Tp, _Up>,
1424 integral_constant<bool,
1425 __is_trivially_assignable(_Tp, _Up)>>
1429 template<
typename _Tp>
1430 struct is_trivially_copy_assignable
1431 :
public __and_<is_copy_assignable<_Tp>,
1432 integral_constant<bool,
1433 __is_trivially_assignable(_Tp&, const _Tp&)>>
1437 template<
typename _Tp>
1438 struct is_trivially_move_assignable
1439 :
public __and_<is_move_assignable<_Tp>,
1440 integral_constant<bool,
1441 __is_trivially_assignable(_Tp&, _Tp&&)>>
1445 template<
typename _Tp>
1446 struct is_trivially_destructible
1447 :
public __and_<is_destructible<_Tp>, integral_constant<bool,
1448 __has_trivial_destructor(_Tp)>>
1453 template<
typename _Tp>
1454 struct has_virtual_destructor
1462 template<
typename _Tp>
1471 template<
typename _Tp, std::
size_t _Size>
1472 struct rank<_Tp[_Size]>
1475 template<
typename _Tp>
1480 template<
typename,
unsigned _U
int>
1484 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1485 struct extent<_Tp[_Size], _Uint>
1487 _Uint == 0 ? _Size : extent<_Tp,
1491 template<
typename _Tp,
unsigned _U
int>
1492 struct extent<_Tp[], _Uint>
1494 _Uint == 0 ? 0 : extent<_Tp,
1502 template<
typename,
typename>
1504 :
public false_type { };
1506 template<
typename _Tp>
1507 struct is_same<_Tp, _Tp>
1508 :
public true_type { };
1511 template<
typename _Base,
typename _Derived>
1516 template<
typename _From,
typename _To,
1519 struct __is_convertible_helper
1522 template<
typename _From,
typename _To>
1523 class __is_convertible_helper<_From, _To, false>
1525 template<
typename _To1>
1526 static void __test_aux(_To1);
1528 template<
typename _From1,
typename _To1,
1529 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1533 template<
typename,
typename>
1538 typedef decltype(__test<_From, _To>(0))
type;
1543 template<
typename _From,
typename _To>
1544 struct is_convertible
1545 :
public __is_convertible_helper<_From, _To>
::type 1552 template<
typename _Tp>
1554 {
typedef _Tp
type; };
1556 template<
typename _Tp>
1557 struct remove_const<_Tp const>
1558 {
typedef _Tp
type; };
1561 template<
typename _Tp>
1562 struct remove_volatile
1563 {
typedef _Tp
type; };
1565 template<
typename _Tp>
1566 struct remove_volatile<_Tp volatile>
1567 {
typedef _Tp
type; };
1570 template<
typename _Tp>
1574 remove_const<typename remove_volatile<_Tp>::type>
::type type;
1578 template<
typename _Tp>
1580 {
typedef _Tp
const type; };
1583 template<
typename _Tp>
1585 {
typedef _Tp
volatile type; };
1588 template<
typename _Tp>
1592 add_const<typename add_volatile<_Tp>::type>
::type type;
1595 #if __cplusplus > 201103L 1597 #define __cpp_lib_transformation_trait_aliases 201304 1600 template<
typename _Tp>
1601 using remove_const_t =
typename remove_const<_Tp>::type;
1604 template<
typename _Tp>
1605 using remove_volatile_t =
typename remove_volatile<_Tp>::type;
1608 template<
typename _Tp>
1609 using remove_cv_t =
typename remove_cv<_Tp>::type;
1612 template<
typename _Tp>
1613 using add_const_t =
typename add_const<_Tp>::type;
1616 template<
typename _Tp>
1617 using add_volatile_t =
typename add_volatile<_Tp>::type;
1620 template<
typename _Tp>
1621 using add_cv_t =
typename add_cv<_Tp>::type;
1627 template<
typename _Tp>
1628 struct remove_reference
1629 {
typedef _Tp
type; };
1631 template<
typename _Tp>
1632 struct remove_reference<_Tp&>
1633 {
typedef _Tp
type; };
1635 template<
typename _Tp>
1636 struct remove_reference<_Tp&&>
1637 {
typedef _Tp
type; };
1639 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1640 struct __add_lvalue_reference_helper
1641 {
typedef _Tp
type; };
1643 template<
typename _Tp>
1644 struct __add_lvalue_reference_helper<_Tp, true>
1645 {
typedef _Tp&
type; };
1648 template<
typename _Tp>
1649 struct add_lvalue_reference
1650 :
public __add_lvalue_reference_helper<_Tp>
1653 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1654 struct __add_rvalue_reference_helper
1655 {
typedef _Tp
type; };
1657 template<
typename _Tp>
1658 struct __add_rvalue_reference_helper<_Tp, true>
1659 {
typedef _Tp&&
type; };
1662 template<
typename _Tp>
1663 struct add_rvalue_reference
1664 :
public __add_rvalue_reference_helper<_Tp>
1667 #if __cplusplus > 201103L 1669 template<
typename _Tp>
1670 using remove_reference_t =
typename remove_reference<_Tp>::type;
1673 template<
typename _Tp>
1674 using add_lvalue_reference_t =
typename add_lvalue_reference<_Tp>::type;
1677 template<
typename _Tp>
1678 using add_rvalue_reference_t =
typename add_rvalue_reference<_Tp>::type;
1684 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1685 struct __cv_selector;
1687 template<
typename _Unqualified>
1688 struct __cv_selector<_Unqualified, false, false>
1689 {
typedef _Unqualified __type; };
1691 template<
typename _Unqualified>
1692 struct __cv_selector<_Unqualified, false, true>
1693 {
typedef volatile _Unqualified __type; };
1695 template<
typename _Unqualified>
1696 struct __cv_selector<_Unqualified, true, false>
1697 {
typedef const _Unqualified __type; };
1699 template<
typename _Unqualified>
1700 struct __cv_selector<_Unqualified, true, true>
1701 {
typedef const volatile _Unqualified __type; };
1703 template<
typename _Qualified,
typename _Unqualified,
1706 class __match_cv_qualifiers
1708 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1711 typedef typename __match::__type __type;
1715 template<
typename _Tp>
1716 struct __make_unsigned
1717 {
typedef _Tp __type; };
1720 struct __make_unsigned<char>
1721 {
typedef unsigned char __type; };
1724 struct __make_unsigned<signed char>
1725 {
typedef unsigned char __type; };
1728 struct __make_unsigned<short>
1729 {
typedef unsigned short __type; };
1732 struct __make_unsigned<int>
1733 {
typedef unsigned int __type; };
1736 struct __make_unsigned<long>
1737 {
typedef unsigned long __type; };
1740 struct __make_unsigned<long long>
1741 {
typedef unsigned long long __type; };
1743 #if defined(_GLIBCXX_USE_WCHAR_T) && !defined(__WCHAR_UNSIGNED__) 1745 struct __make_unsigned<wchar_t> : __make_unsigned<__WCHAR_TYPE__>
1749 #if defined(__GLIBCXX_TYPE_INT_N_0) 1751 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1752 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1754 #if defined(__GLIBCXX_TYPE_INT_N_1) 1756 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1757 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1759 #if defined(__GLIBCXX_TYPE_INT_N_2) 1761 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1762 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1764 #if defined(__GLIBCXX_TYPE_INT_N_3) 1766 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1767 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1771 template<
typename _Tp,
1774 class __make_unsigned_selector;
1776 template<
typename _Tp>
1777 class __make_unsigned_selector<_Tp, true, false>
1779 typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1780 typedef typename __unsignedt::__type __unsigned_type;
1781 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1784 typedef typename __cv_unsigned::__type __type;
1787 template<
typename _Tp>
1788 class __make_unsigned_selector<_Tp, false, true>
1791 typedef unsigned char __smallest;
1792 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1793 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
unsigned short);
1794 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
unsigned int);
1795 static const bool __b3 =
sizeof(_Tp) <=
sizeof(
unsigned long);
1796 typedef conditional<__b3, unsigned long, unsigned long long> __cond3;
1797 typedef typename __cond3::type __cond3_type;
1798 typedef conditional<__b2, unsigned int, __cond3_type> __cond2;
1799 typedef typename __cond2::type __cond2_type;
1800 typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
1801 typedef typename __cond1::type __cond1_type;
1803 typedef typename conditional<__b0, __smallest, __cond1_type>::type
1805 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1808 typedef typename __cv_unsigned::__type __type;
1815 template<
typename _Tp>
1816 struct make_unsigned
1817 {
typedef typename __make_unsigned_selector<_Tp>::__type
type; };
1821 struct make_unsigned<bool>;
1825 template<
typename _Tp>
1826 struct __make_signed
1827 {
typedef _Tp __type; };
1830 struct __make_signed<char>
1831 {
typedef signed char __type; };
1834 struct __make_signed<unsigned char>
1835 {
typedef signed char __type; };
1838 struct __make_signed<unsigned short>
1839 {
typedef signed short __type; };
1842 struct __make_signed<unsigned int>
1843 {
typedef signed int __type; };
1846 struct __make_signed<unsigned long>
1847 {
typedef signed long __type; };
1850 struct __make_signed<unsigned long long>
1851 {
typedef signed long long __type; };
1853 #if defined(_GLIBCXX_USE_WCHAR_T) && defined(__WCHAR_UNSIGNED__) 1855 struct __make_signed<wchar_t> : __make_signed<__WCHAR_TYPE__>
1859 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 1861 struct __make_signed<char16_t> : __make_signed<uint_least16_t>
1864 struct __make_signed<char32_t> : __make_signed<uint_least32_t>
1868 #if defined(__GLIBCXX_TYPE_INT_N_0) 1870 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1871 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1873 #if defined(__GLIBCXX_TYPE_INT_N_1) 1875 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1876 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1878 #if defined(__GLIBCXX_TYPE_INT_N_2) 1880 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1881 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1883 #if defined(__GLIBCXX_TYPE_INT_N_3) 1885 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1886 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1890 template<
typename _Tp,
1893 class __make_signed_selector;
1895 template<
typename _Tp>
1896 class __make_signed_selector<_Tp, true, false>
1898 typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1899 typedef typename __signedt::__type __signed_type;
1900 typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1903 typedef typename __cv_signed::__type __type;
1906 template<
typename _Tp>
1907 class __make_signed_selector<_Tp, false, true>
1909 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1912 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1919 template<
typename _Tp>
1921 {
typedef typename __make_signed_selector<_Tp>::__type
type; };
1925 struct make_signed<bool>;
1927 #if __cplusplus > 201103L 1929 template<
typename _Tp>
1930 using make_signed_t =
typename make_signed<_Tp>::type;
1933 template<
typename _Tp>
1934 using make_unsigned_t =
typename make_unsigned<_Tp>::type;
1940 template<
typename _Tp>
1941 struct remove_extent
1942 {
typedef _Tp
type; };
1944 template<
typename _Tp, std::
size_t _Size>
1945 struct remove_extent<_Tp[_Size]>
1946 {
typedef _Tp
type; };
1948 template<
typename _Tp>
1949 struct remove_extent<_Tp[]>
1950 {
typedef _Tp
type; };
1953 template<
typename _Tp>
1954 struct remove_all_extents
1955 {
typedef _Tp
type; };
1957 template<
typename _Tp, std::
size_t _Size>
1958 struct remove_all_extents<_Tp[_Size]>
1959 {
typedef typename remove_all_extents<_Tp>::type
type; };
1961 template<
typename _Tp>
1962 struct remove_all_extents<_Tp[]>
1963 {
typedef typename remove_all_extents<_Tp>::type
type; };
1965 #if __cplusplus > 201103L 1967 template<
typename _Tp>
1968 using remove_extent_t =
typename remove_extent<_Tp>::type;
1971 template<
typename _Tp>
1972 using remove_all_extents_t =
typename remove_all_extents<_Tp>::type;
1977 template<
typename _Tp,
typename>
1978 struct __remove_pointer_helper
1979 {
typedef _Tp
type; };
1981 template<
typename _Tp,
typename _Up>
1982 struct __remove_pointer_helper<_Tp, _Up*>
1983 {
typedef _Up
type; };
1986 template<
typename _Tp>
1987 struct remove_pointer
1988 :
public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1992 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
1993 is_
void<_Tp>>::value>
1994 struct __add_pointer_helper
1995 {
typedef _Tp
type; };
1997 template<
typename _Tp>
1998 struct __add_pointer_helper<_Tp, true>
1999 {
typedef typename remove_reference<_Tp>::type*
type; };
2001 template<
typename _Tp>
2003 :
public __add_pointer_helper<_Tp>
2006 #if __cplusplus > 201103L 2008 template<
typename _Tp>
2009 using remove_pointer_t =
typename remove_pointer<_Tp>::type;
2012 template<
typename _Tp>
2013 using add_pointer_t =
typename add_pointer<_Tp>::type;
2016 template<std::
size_t _Len>
2017 struct __aligned_storage_msa
2021 unsigned char __data[_Len];
2022 struct __attribute__((__aligned__)) { } __align;
2036 template<std::size_t _Len, std::size_t _Align =
2037 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2038 struct aligned_storage
2042 unsigned char __data[_Len];
2043 struct __attribute__((__aligned__((_Align)))) { } __align;
2047 template <
typename... _Types>
2048 struct __strictest_alignment
2050 static const size_t _S_alignment = 0;
2051 static const size_t _S_size = 0;
2054 template <
typename _Tp,
typename... _Types>
2055 struct __strictest_alignment<_Tp, _Types...>
2057 static const size_t _S_alignment =
2058 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
2059 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
2060 static const size_t _S_size =
2061 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
2062 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
2075 template <
size_t _Len,
typename... _Types>
2076 struct aligned_union
2079 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
2081 using __strictest = __strictest_alignment<_Types...>;
2082 static const size_t _S_len = _Len > __strictest::_S_size
2083 ? _Len : __strictest::_S_size;
2086 static const size_t alignment_value = __strictest::_S_alignment;
2088 typedef typename aligned_storage<_S_len, alignment_value>::type
type;
2091 template <
size_t _Len,
typename... _Types>
2092 const size_t aligned_union<_Len, _Types...>::alignment_value;
2096 template<
typename _Up,
2099 struct __decay_selector;
2102 template<
typename _Up>
2103 struct __decay_selector<_Up, false, false>
2104 {
typedef typename remove_cv<_Up>::type __type; };
2106 template<
typename _Up>
2107 struct __decay_selector<_Up, true, false>
2108 {
typedef typename remove_extent<_Up>::type* __type; };
2110 template<
typename _Up>
2111 struct __decay_selector<_Up, false, true>
2112 {
typedef typename add_pointer<_Up>::type __type; };
2115 template<
typename _Tp>
2118 typedef typename remove_reference<_Tp>::type __remove_type;
2121 typedef typename __decay_selector<__remove_type>::__type
type;
2124 template<
typename _Tp>
2128 template<
typename _Tp>
2129 struct __strip_reference_wrapper
2134 template<
typename _Tp>
2135 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
2137 typedef _Tp& __type;
2140 template<
typename _Tp>
2141 struct __decay_and_strip
2143 typedef typename __strip_reference_wrapper<
2144 typename decay<_Tp>::type>::__type __type;
2150 template<
bool,
typename _Tp =
void>
2155 template<
typename _Tp>
2156 struct enable_if<true, _Tp>
2157 {
typedef _Tp
type; };
2159 template<
typename... _Cond>
2160 using _Require =
typename enable_if<__and_<_Cond...>::value>
::type;
2164 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2166 {
typedef _Iftrue
type; };
2169 template<
typename _Iftrue,
typename _Iffalse>
2170 struct conditional<false, _Iftrue, _Iffalse>
2171 {
typedef _Iffalse
type; };
2174 template<
typename... _Tp>
2179 struct __do_common_type_impl
2181 template<
typename _Tp,
typename _Up>
2182 static __success_type<
typename decay<decltype
2183 (
true ? std::declval<_Tp>()
2184 : std::declval<_Up>())>::type> _S_test(
int);
2186 template<
typename,
typename>
2187 static __failure_type _S_test(...);
2190 template<
typename _Tp,
typename _Up>
2191 struct __common_type_impl
2192 :
private __do_common_type_impl
2194 typedef decltype(_S_test<_Tp, _Up>(0))
type;
2197 struct __do_member_type_wrapper
2199 template<
typename _Tp>
2200 static __success_type<typename _Tp::type> _S_test(
int);
2203 static __failure_type _S_test(...);
2206 template<
typename _Tp>
2207 struct __member_type_wrapper
2208 :
private __do_member_type_wrapper
2210 typedef decltype(_S_test<_Tp>(0))
type;
2213 template<
typename _CTp,
typename... _Args>
2214 struct __expanded_common_type_wrapper
2216 typedef common_type<
typename _CTp::type, _Args...>
type;
2219 template<
typename... _Args>
2220 struct __expanded_common_type_wrapper<__failure_type, _Args...>
2221 {
typedef __failure_type
type; };
2223 template<
typename _Tp>
2224 struct common_type<_Tp>
2225 {
typedef typename decay<_Tp>::type
type; };
2227 template<
typename _Tp,
typename _Up>
2228 struct common_type<_Tp, _Up>
2229 :
public __common_type_impl<_Tp, _Up>::type
2232 template<
typename _Tp,
typename _Up,
typename... _Vp>
2233 struct common_type<_Tp, _Up, _Vp...>
2234 :
public __expanded_common_type_wrapper<typename __member_type_wrapper<
2235 common_type<_Tp, _Up>>::type, _Vp...>::type
2239 template<
typename _Tp>
2240 struct underlying_type
2242 typedef __underlying_type(_Tp)
type;
2245 template<
typename _Tp>
2246 struct __declval_protector
2248 static const bool __stop =
false;
2249 static typename add_rvalue_reference<_Tp>::type __delegate();
2252 template<
typename _Tp>
2253 inline typename add_rvalue_reference<_Tp>::type
2256 static_assert(__declval_protector<_Tp>::__stop,
2257 "declval() must not be used!");
2258 return __declval_protector<_Tp>::__delegate();
2262 template<
typename _Signature>
2267 #define __cpp_lib_result_of_sfinae 201210 2269 struct __invoke_memfun_ref { };
2270 struct __invoke_memfun_deref { };
2271 struct __invoke_memobj_ref { };
2272 struct __invoke_memobj_deref { };
2273 struct __invoke_other { };
2276 template<
typename _Tp,
typename _Tag>
2277 struct __result_of_success : __success_type<_Tp>
2278 {
using __invoke_type = _Tag; };
2281 struct __result_of_memfun_ref_impl
2283 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2284 static __result_of_success<decltype(
2285 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2286 ), __invoke_memfun_ref> _S_test(
int);
2288 template<
typename...>
2289 static __failure_type _S_test(...);
2292 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2293 struct __result_of_memfun_ref
2294 :
private __result_of_memfun_ref_impl
2296 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0))
type;
2300 struct __result_of_memfun_deref_impl
2302 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2303 static __result_of_success<decltype(
2304 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2305 ), __invoke_memfun_deref> _S_test(
int);
2307 template<
typename...>
2308 static __failure_type _S_test(...);
2311 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2312 struct __result_of_memfun_deref
2313 :
private __result_of_memfun_deref_impl
2315 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0))
type;
2319 struct __result_of_memobj_ref_impl
2321 template<
typename _Fp,
typename _Tp1>
2322 static __result_of_success<decltype(
2323 std::declval<_Tp1>().*std::declval<_Fp>()
2324 ), __invoke_memobj_ref> _S_test(
int);
2326 template<
typename,
typename>
2327 static __failure_type _S_test(...);
2330 template<
typename _MemPtr,
typename _Arg>
2331 struct __result_of_memobj_ref
2332 :
private __result_of_memobj_ref_impl
2334 typedef decltype(_S_test<_MemPtr, _Arg>(0))
type;
2338 struct __result_of_memobj_deref_impl
2340 template<
typename _Fp,
typename _Tp1>
2341 static __result_of_success<decltype(
2342 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2343 ), __invoke_memobj_deref> _S_test(
int);
2345 template<
typename,
typename>
2346 static __failure_type _S_test(...);
2349 template<
typename _MemPtr,
typename _Arg>
2350 struct __result_of_memobj_deref
2351 :
private __result_of_memobj_deref_impl
2353 typedef decltype(_S_test<_MemPtr, _Arg>(0))
type;
2356 template<
typename _MemPtr,
typename _Arg>
2357 struct __result_of_memobj;
2359 template<
typename _Res,
typename _Class,
typename _Arg>
2360 struct __result_of_memobj<_Res _Class::*, _Arg>
2362 typedef typename remove_cv<
typename remove_reference<
2363 _Arg>::type>::type _Argval;
2364 typedef _Res _Class::* _MemPtr;
2365 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2366 is_base_of<_Class, _Argval>>::value,
2367 __result_of_memobj_ref<_MemPtr, _Arg>,
2368 __result_of_memobj_deref<_MemPtr, _Arg>
2372 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2373 struct __result_of_memfun;
2375 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2376 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2378 typedef typename remove_cv<
typename remove_reference<
2379 _Arg>::type>::type _Argval;
2380 typedef _Res _Class::* _MemPtr;
2381 typedef typename conditional<__or_<is_same<_Argval, _Class>,
2382 is_base_of<_Class, _Argval>>::value,
2383 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2384 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2393 template<typename _Tp, typename _Up = typename decay<_Tp>::type>
2399 template<
typename _Tp,
typename _Up>
2400 struct __inv_unwrap<_Tp, reference_wrapper<_Up>>
2405 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2406 struct __result_of_impl
2408 typedef __failure_type
type;
2411 template<
typename _MemPtr,
typename _Arg>
2412 struct __result_of_impl<true, false, _MemPtr, _Arg>
2413 :
public __result_of_memobj<typename decay<_MemPtr>::type,
2414 typename __inv_unwrap<_Arg>::type>
2417 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2418 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2419 :
public __result_of_memfun<typename decay<_MemPtr>::type,
2420 typename __inv_unwrap<_Arg>::type, _Args...>
2424 struct __result_of_other_impl
2426 template<
typename _Fn,
typename... _Args>
2427 static __result_of_success<decltype(
2428 std::declval<_Fn>()(std::declval<_Args>()...)
2429 ), __invoke_other> _S_test(
int);
2431 template<
typename...>
2432 static __failure_type _S_test(...);
2435 template<
typename _Functor,
typename... _ArgTypes>
2436 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2437 :
private __result_of_other_impl
2439 typedef decltype(_S_test<_Functor, _ArgTypes...>(0))
type;
2443 template<
typename _Functor,
typename... _ArgTypes>
2444 struct __invoke_result
2445 :
public __result_of_impl<
2446 is_member_object_pointer<
2447 typename remove_reference<_Functor>::type
2449 is_member_function_pointer<
2450 typename remove_reference<_Functor>::type
2452 _Functor, _ArgTypes...
2456 template<
typename _Functor,
typename... _ArgTypes>
2457 struct result_of<_Functor(_ArgTypes...)>
2458 :
public __invoke_result<_Functor, _ArgTypes...>
2461 #if __cplusplus > 201103L 2463 template<
size_t _Len,
size_t _Align =
2464 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2465 using aligned_storage_t =
typename aligned_storage<_Len, _Align>::type;
2467 template <
size_t _Len,
typename... _Types>
2468 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2471 template<
typename _Tp>
2472 using decay_t =
typename decay<_Tp>::type;
2475 template<
bool _Cond,
typename _Tp =
void>
2476 using enable_if_t =
typename enable_if<_Cond, _Tp>::type;
2479 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2480 using conditional_t =
typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2483 template<
typename... _Tp>
2484 using common_type_t =
typename common_type<_Tp...>::type;
2487 template<
typename _Tp>
2488 using underlying_type_t =
typename underlying_type<_Tp>::type;
2491 template<
typename _Tp>
2492 using result_of_t =
typename result_of<_Tp>::type;
2495 template<
typename...>
using __void_t = void;
2497 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 2498 #define __cpp_lib_void_t 201411 2500 template<
typename...>
using void_t = void;
2504 template<
typename _Default,
typename _AlwaysVoid,
2505 template<
typename...>
class _Op,
typename... _Args>
2509 using type = _Default;
2513 template<
typename _Default,
template<
typename...>
class _Op,
2515 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2518 using type = _Op<_Args...>;
2522 template<
typename _Default,
template<
typename...>
class _Op,
2524 using __detected_or = __detector<_Default, void, _Op, _Args...>;
2527 template<
typename _Default,
template<
typename...>
class _Op,
2529 using __detected_or_t
2530 =
typename __detected_or<_Default, _Op, _Args...>::type;
2538 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \ 2539 template<typename _Tp, typename = __void_t<>> \ 2540 struct __has_##_NTYPE \ 2543 template<typename _Tp> \ 2544 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \ 2548 template <
typename _Tp>
2549 struct __is_swappable;
2551 template <
typename _Tp>
2552 struct __is_nothrow_swappable;
2554 template<
typename... _Elements>
2558 struct __is_tuple_like_impl : false_type
2561 template<
typename... _Tps>
2562 struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
2566 template<
typename _Tp>
2567 struct __is_tuple_like
2568 :
public __is_tuple_like_impl<typename remove_cv<
2569 typename remove_reference<_Tp>::type>::type>::type
2572 template<
typename _Tp>
2574 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
2575 is_move_constructible<_Tp>,
2576 is_move_assignable<_Tp>>::value>::type
2578 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2579 is_nothrow_move_assignable<_Tp>>::value);
2581 template<
typename _Tp,
size_t _Nm>
2583 typename enable_if<__is_swappable<_Tp>::value>::type
2584 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2585 noexcept(__is_nothrow_swappable<_Tp>::value);
2587 namespace __swappable_details {
2590 struct __do_is_swappable_impl
2592 template<
typename _Tp,
typename 2593 = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2594 static true_type __test(
int);
2597 static false_type __test(...);
2600 struct __do_is_nothrow_swappable_impl
2602 template<
typename _Tp>
2603 static __bool_constant<
2604 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2608 static false_type __test(...);
2613 template<
typename _Tp>
2614 struct __is_swappable_impl
2615 :
public __swappable_details::__do_is_swappable_impl
2617 typedef decltype(__test<_Tp>(0))
type;
2620 template<
typename _Tp>
2621 struct __is_nothrow_swappable_impl
2622 :
public __swappable_details::__do_is_nothrow_swappable_impl
2624 typedef decltype(__test<_Tp>(0))
type;
2627 template<
typename _Tp>
2628 struct __is_swappable
2629 :
public __is_swappable_impl<_Tp>::type
2632 template<
typename _Tp>
2633 struct __is_nothrow_swappable
2634 :
public __is_nothrow_swappable_impl<_Tp>::type
2637 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 2638 #define __cpp_lib_is_swappable 201603 2642 template<
typename _Tp>
2644 :
public __is_swappable_impl<_Tp>::type
2648 template<
typename _Tp>
2649 struct is_nothrow_swappable
2650 :
public __is_nothrow_swappable_impl<_Tp>::type
2653 #if __cplusplus >= 201402L 2655 template<
typename _Tp>
2656 _GLIBCXX17_INLINE constexpr
bool is_swappable_v =
2657 is_swappable<_Tp>::value;
2660 template<
typename _Tp>
2661 _GLIBCXX17_INLINE constexpr
bool is_nothrow_swappable_v =
2662 is_nothrow_swappable<_Tp>::value;
2663 #endif // __cplusplus >= 201402L 2665 namespace __swappable_with_details {
2668 struct __do_is_swappable_with_impl
2670 template<
typename _Tp,
typename _Up,
typename 2671 = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2673 = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2674 static true_type __test(
int);
2676 template<
typename,
typename>
2677 static false_type __test(...);
2680 struct __do_is_nothrow_swappable_with_impl
2682 template<
typename _Tp,
typename _Up>
2683 static __bool_constant<
2684 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2686 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2689 template<
typename,
typename>
2690 static false_type __test(...);
2695 template<
typename _Tp,
typename _Up>
2696 struct __is_swappable_with_impl
2697 :
public __swappable_with_details::__do_is_swappable_with_impl
2699 typedef decltype(__test<_Tp, _Up>(0))
type;
2703 template<
typename _Tp>
2704 struct __is_swappable_with_impl<_Tp&, _Tp&>
2705 :
public __swappable_details::__do_is_swappable_impl
2707 typedef decltype(__test<_Tp&>(0))
type;
2710 template<
typename _Tp,
typename _Up>
2711 struct __is_nothrow_swappable_with_impl
2712 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2714 typedef decltype(__test<_Tp, _Up>(0))
type;
2718 template<
typename _Tp>
2719 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2720 :
public __swappable_details::__do_is_nothrow_swappable_impl
2722 typedef decltype(__test<_Tp&>(0))
type;
2726 template<
typename _Tp,
typename _Up>
2727 struct is_swappable_with
2728 :
public __is_swappable_with_impl<_Tp, _Up>::type
2732 template<
typename _Tp,
typename _Up>
2733 struct is_nothrow_swappable_with
2734 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2737 #if __cplusplus >= 201402L 2739 template<
typename _Tp,
typename _Up>
2740 _GLIBCXX17_INLINE constexpr
bool is_swappable_with_v =
2741 is_swappable_with<_Tp, _Up>::value;
2744 template<
typename _Tp,
typename _Up>
2745 _GLIBCXX17_INLINE constexpr
bool is_nothrow_swappable_with_v =
2746 is_nothrow_swappable_with<_Tp, _Up>::value;
2747 #endif // __cplusplus >= 201402L 2749 #endif// c++1z or gnu++11 2753 template<
typename _Result,
typename _Ret,
typename =
void>
2754 struct __is_invocable_impl : false_type { };
2756 template<
typename _Result,
typename _Ret>
2757 struct __is_invocable_impl<_Result, _Ret, __void_t<typename _Result::
type>>
2758 : is_convertible<typename _Result::type, _Ret>::type
2761 template<
typename _Result>
2762 struct __is_invocable_impl<_Result, void, __void_t<typename _Result::
type>>
2766 template<
typename _Fn,
typename... _ArgTypes>
2767 struct __is_invocable
2768 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2771 template<
typename _Fn,
typename _Tp,
typename... _Args>
2772 constexpr
bool __call_is_nt(__invoke_memfun_ref)
2774 using _Up =
typename __inv_unwrap<_Tp>::type;
2775 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2776 std::declval<_Args>()...));
2779 template<
typename _Fn,
typename _Tp,
typename... _Args>
2780 constexpr
bool __call_is_nt(__invoke_memfun_deref)
2782 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2783 std::declval<_Args>()...));
2786 template<
typename _Fn,
typename _Tp>
2787 constexpr
bool __call_is_nt(__invoke_memobj_ref)
2789 using _Up =
typename __inv_unwrap<_Tp>::type;
2790 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2793 template<
typename _Fn,
typename _Tp>
2794 constexpr
bool __call_is_nt(__invoke_memobj_deref)
2796 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2799 template<
typename _Fn,
typename... _Args>
2800 constexpr
bool __call_is_nt(__invoke_other)
2802 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2805 template<
typename _Result,
typename _Fn,
typename... _Args>
2806 struct __call_is_nothrow
2808 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2812 template<
typename _Fn,
typename... _Args>
2813 using __call_is_nothrow_
2814 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2817 template<
typename _Fn,
typename... _Args>
2818 struct __is_nothrow_invocable
2819 : __and_<__is_invocable<_Fn, _Args...>,
2820 __call_is_nothrow_<_Fn, _Args...>>::type
2824 __nonesuch() =
delete;
2825 ~__nonesuch() =
delete;
2826 __nonesuch(__nonesuch
const&) =
delete;
2827 void operator=(__nonesuch
const&) =
delete;
2830 #if __cplusplus > 201402L 2831 # define __cpp_lib_is_invocable 201703 2834 template<
typename _Functor,
typename... _ArgTypes>
2835 struct invoke_result
2836 :
public __invoke_result<_Functor, _ArgTypes...>
2840 template<
typename _Fn,
typename... _Args>
2841 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
2844 template<
typename _Fn,
typename... _ArgTypes>
2846 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2850 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2851 struct is_invocable_r
2852 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2856 template<
typename _Fn,
typename... _ArgTypes>
2857 struct is_nothrow_invocable
2858 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2859 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2862 template<
typename _Result,
typename _Ret,
typename =
void>
2863 struct __is_nt_invocable_impl : false_type { };
2865 template<
typename _Result,
typename _Ret>
2866 struct __is_nt_invocable_impl<_Result, _Ret,
2867 __void_t<typename _Result::
type>>
2868 : __and_<is_convertible<typename _Result::type, _Ret>,
2869 is_nothrow_constructible<_Ret, typename _Result::type>>
2872 template<
typename _Result>
2873 struct __is_nt_invocable_impl<_Result, void,
2874 __void_t<typename _Result::
type>>
2879 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2880 struct is_nothrow_invocable_r
2881 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
2882 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2886 template<
typename _Fn,
typename... _Args>
2887 inline constexpr
bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
2890 template<
typename _Fn,
typename... _Args>
2891 inline constexpr
bool is_nothrow_invocable_v
2892 = is_nothrow_invocable<_Fn, _Args...>::value;
2895 template<
typename _Fn,
typename... _Args>
2896 inline constexpr
bool is_invocable_r_v
2897 = is_invocable_r<_Fn, _Args...>::value;
2900 template<
typename _Fn,
typename... _Args>
2901 inline constexpr
bool is_nothrow_invocable_r_v
2902 = is_nothrow_invocable_r<_Fn, _Args...>::value;
2905 #if __cplusplus > 201402L 2906 # define __cpp_lib_type_trait_variable_templates 201510L 2907 template <
typename _Tp>
2909 template <
typename _Tp>
2911 template <
typename _Tp>
2913 template <
typename _Tp>
2915 template <
typename _Tp>
2917 template <
typename _Tp>
2919 template <
typename _Tp>
2920 inline constexpr
bool is_lvalue_reference_v =
2922 template <
typename _Tp>
2923 inline constexpr
bool is_rvalue_reference_v =
2925 template <
typename _Tp>
2926 inline constexpr
bool is_member_object_pointer_v =
2928 template <
typename _Tp>
2929 inline constexpr
bool is_member_function_pointer_v =
2931 template <
typename _Tp>
2933 template <
typename _Tp>
2935 template <
typename _Tp>
2937 template <
typename _Tp>
2939 template <
typename _Tp>
2941 template <
typename _Tp>
2943 template <
typename _Tp>
2945 template <
typename _Tp>
2947 template <
typename _Tp>
2949 template <
typename _Tp>
2951 template <
typename _Tp>
2953 template <
typename _Tp>
2955 template <
typename _Tp>
2957 template <
typename _Tp>
2959 template <
typename _Tp>
2960 inline constexpr
bool is_trivially_copyable_v =
2961 is_trivially_copyable<_Tp>::value;
2962 template <
typename _Tp>
2964 template <
typename _Tp>
2966 template <
typename _Tp>
2968 template <
typename _Tp>
2970 template <
typename _Tp>
2972 template <
typename _Tp>
2974 template <
typename _Tp>
2976 template <
typename _Tp>
2977 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
2978 template <
typename _Tp>
2979 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
2980 template <
typename _Tp,
typename... _Args>
2981 inline constexpr
bool is_constructible_v =
2982 is_constructible<_Tp, _Args...>::value;
2983 template <
typename _Tp>
2984 inline constexpr
bool is_default_constructible_v =
2985 is_default_constructible<_Tp>::value;
2986 template <
typename _Tp>
2987 inline constexpr
bool is_copy_constructible_v =
2988 is_copy_constructible<_Tp>::value;
2989 template <
typename _Tp>
2990 inline constexpr
bool is_move_constructible_v =
2991 is_move_constructible<_Tp>::value;
2992 template <
typename _Tp,
typename _Up>
2993 inline constexpr
bool is_assignable_v = is_assignable<_Tp, _Up>::value;
2994 template <
typename _Tp>
2995 inline constexpr
bool is_copy_assignable_v = is_copy_assignable<_Tp>::value;
2996 template <
typename _Tp>
2997 inline constexpr
bool is_move_assignable_v = is_move_assignable<_Tp>::value;
2998 template <
typename _Tp>
2999 inline constexpr
bool is_destructible_v = is_destructible<_Tp>::value;
3000 template <
typename _Tp,
typename... _Args>
3001 inline constexpr
bool is_trivially_constructible_v =
3002 is_trivially_constructible<_Tp, _Args...>::value;
3003 template <
typename _Tp>
3004 inline constexpr
bool is_trivially_default_constructible_v =
3005 is_trivially_default_constructible<_Tp>::value;
3006 template <
typename _Tp>
3007 inline constexpr
bool is_trivially_copy_constructible_v =
3008 is_trivially_copy_constructible<_Tp>::value;
3009 template <
typename _Tp>
3010 inline constexpr
bool is_trivially_move_constructible_v =
3011 is_trivially_move_constructible<_Tp>::value;
3012 template <
typename _Tp,
typename _Up>
3013 inline constexpr
bool is_trivially_assignable_v =
3014 is_trivially_assignable<_Tp, _Up>::value;
3015 template <
typename _Tp>
3016 inline constexpr
bool is_trivially_copy_assignable_v =
3017 is_trivially_copy_assignable<_Tp>::value;
3018 template <
typename _Tp>
3019 inline constexpr
bool is_trivially_move_assignable_v =
3020 is_trivially_move_assignable<_Tp>::value;
3021 template <
typename _Tp>
3022 inline constexpr
bool is_trivially_destructible_v =
3023 is_trivially_destructible<_Tp>::value;
3024 template <
typename _Tp,
typename... _Args>
3025 inline constexpr
bool is_nothrow_constructible_v =
3026 is_nothrow_constructible<_Tp, _Args...>::value;
3027 template <
typename _Tp>
3028 inline constexpr
bool is_nothrow_default_constructible_v =
3029 is_nothrow_default_constructible<_Tp>::value;
3030 template <
typename _Tp>
3031 inline constexpr
bool is_nothrow_copy_constructible_v =
3032 is_nothrow_copy_constructible<_Tp>::value;
3033 template <
typename _Tp>
3034 inline constexpr
bool is_nothrow_move_constructible_v =
3035 is_nothrow_move_constructible<_Tp>::value;
3036 template <
typename _Tp,
typename _Up>
3037 inline constexpr
bool is_nothrow_assignable_v =
3038 is_nothrow_assignable<_Tp, _Up>::value;
3039 template <
typename _Tp>
3040 inline constexpr
bool is_nothrow_copy_assignable_v =
3041 is_nothrow_copy_assignable<_Tp>::value;
3042 template <
typename _Tp>
3043 inline constexpr
bool is_nothrow_move_assignable_v =
3044 is_nothrow_move_assignable<_Tp>::value;
3045 template <
typename _Tp>
3046 inline constexpr
bool is_nothrow_destructible_v =
3047 is_nothrow_destructible<_Tp>::value;
3048 template <
typename _Tp>
3049 inline constexpr
bool has_virtual_destructor_v =
3050 has_virtual_destructor<_Tp>::value;
3051 template <
typename _Tp>
3052 inline constexpr
size_t alignment_of_v = alignment_of<_Tp>::value;
3053 template <
typename _Tp>
3054 inline constexpr
size_t rank_v = rank<_Tp>::value;
3055 template <
typename _Tp,
unsigned _Idx = 0>
3056 inline constexpr
size_t extent_v = extent<_Tp, _Idx>::value;
3057 template <
typename _Tp,
typename _Up>
3058 inline constexpr
bool is_same_v = is_same<_Tp, _Up>::value;
3059 template <
typename _Base,
typename _Derived>
3060 inline constexpr
bool is_base_of_v = is_base_of<_Base, _Derived>::value;
3061 template <
typename _From,
typename _To>
3062 inline constexpr
bool is_convertible_v = is_convertible<_From, _To>::value;
3065 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 3066 #elif defined(__is_identifier) 3068 # if ! __is_identifier(__has_unique_object_representations) 3069 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 3073 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 3074 # define __cpp_lib_has_unique_object_representations 201606 3076 template<
typename _Tp>
3077 struct has_unique_object_representations
3078 : bool_constant<__has_unique_object_representations(
3079 remove_cv_t<remove_all_extents_t<_Tp>>
3083 #undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 3086 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 3087 #elif defined(__is_identifier) 3089 # if ! __is_identifier(__is_aggregate) 3090 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 3094 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 3095 #define __cpp_lib_is_aggregate 201703 3097 template<
typename _Tp>
3099 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> { };
3102 template<
typename _Tp>
3103 inline constexpr
bool is_aggregate_v = is_aggregate<_Tp>::value;
3105 #undef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 3109 _GLIBCXX_END_NAMESPACE_VERSION
3114 #endif // _GLIBCXX_TYPE_TRAITS
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Primary class template, tuple.
is_null_pointer (LWG 2247).
ISO C++ entities toplevel namespace is std.
is_member_function_pointer
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
__is_nullptr_t (extension).
Primary class template for reference_wrapper.