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) && !defined(__CUDACC__) 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>>>
759 template<typename _Tp, typename _Up = _Tp&&>
763 template<typename _Tp>
767 template<typename _Tp>
768 auto declval() noexcept -> decltype(__declval<_Tp>(0));
770 template<typename, unsigned = 0>
776 template<typename _Tp>
777 struct __is_array_known_bounds
781 template<
typename _Tp>
782 struct __is_array_unknown_bounds
783 :
public __and_<is_array<_Tp>, __not_<extent<_Tp>>>
791 struct __do_is_destructible_impl
793 template<
typename _Tp,
typename = decltype(declval<_Tp&>().~_Tp())>
794 static true_type __test(
int);
797 static false_type __test(...);
800 template<
typename _Tp>
801 struct __is_destructible_impl
802 :
public __do_is_destructible_impl
804 typedef decltype(__test<_Tp>(0)) type;
807 template<
typename _Tp,
808 bool = __or_<is_void<_Tp>,
809 __is_array_unknown_bounds<_Tp>,
812 struct __is_destructible_safe;
814 template<
typename _Tp>
815 struct __is_destructible_safe<_Tp, false, false>
816 :
public __is_destructible_impl<typename
817 remove_all_extents<_Tp>::type>::type
820 template<
typename _Tp>
821 struct __is_destructible_safe<_Tp, true, false>
822 :
public false_type { };
824 template<
typename _Tp>
825 struct __is_destructible_safe<_Tp, false, true>
826 :
public true_type { };
829 template<
typename _Tp>
831 :
public __is_destructible_safe<_Tp>::type
838 struct __do_is_nt_destructible_impl
840 template<
typename _Tp>
845 static false_type __test(...);
848 template<
typename _Tp>
849 struct __is_nt_destructible_impl
850 :
public __do_is_nt_destructible_impl
852 typedef decltype(__test<_Tp>(0)) type;
855 template<
typename _Tp,
856 bool = __or_<is_void<_Tp>,
857 __is_array_unknown_bounds<_Tp>,
860 struct __is_nt_destructible_safe;
862 template<
typename _Tp>
863 struct __is_nt_destructible_safe<_Tp, false, false>
864 :
public __is_nt_destructible_impl<typename
865 remove_all_extents<_Tp>::type>::type
868 template<
typename _Tp>
869 struct __is_nt_destructible_safe<_Tp, true, false>
870 :
public false_type { };
872 template<
typename _Tp>
873 struct __is_nt_destructible_safe<_Tp, false, true>
874 :
public true_type { };
877 template<
typename _Tp>
879 :
public __is_nt_destructible_safe<_Tp>::type
882 struct __do_is_default_constructible_impl
884 template<
typename _Tp,
typename = decltype(_Tp())>
885 static true_type __test(
int);
888 static false_type __test(...);
891 template<
typename _Tp>
892 struct __is_default_constructible_impl
893 :
public __do_is_default_constructible_impl
895 typedef decltype(__test<_Tp>(0)) type;
898 template<
typename _Tp>
899 struct __is_default_constructible_atom
900 :
public __and_<__not_<is_void<_Tp>>,
901 __is_default_constructible_impl<_Tp>>
904 template<typename _Tp, bool = is_array<_Tp>::value>
905 struct __is_default_constructible_safe;
912 template<
typename _Tp>
913 struct __is_default_constructible_safe<_Tp, true>
914 :
public __and_<__is_array_known_bounds<_Tp>,
915 __is_default_constructible_atom<typename
916 remove_all_extents<_Tp>::type>>
919 template<
typename _Tp>
920 struct __is_default_constructible_safe<_Tp, false>
921 :
public __is_default_constructible_atom<_Tp>::type
925 template<
typename _Tp>
927 :
public __is_default_constructible_safe<_Tp>::type
931 template<
typename _Tp,
typename... _Args>
933 :
public __bool_constant<__is_constructible(_Tp, _Args...)>
936 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
937 struct __is_copy_constructible_impl;
939 template<
typename _Tp>
940 struct __is_copy_constructible_impl<_Tp, false>
941 :
public false_type { };
943 template<
typename _Tp>
944 struct __is_copy_constructible_impl<_Tp, true>
949 template<
typename _Tp>
951 :
public __is_copy_constructible_impl<_Tp>
954 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
955 struct __is_move_constructible_impl;
957 template<
typename _Tp>
958 struct __is_move_constructible_impl<_Tp, false>
959 :
public false_type { };
961 template<
typename _Tp>
962 struct __is_move_constructible_impl<_Tp, true>
967 template<
typename _Tp>
969 :
public __is_move_constructible_impl<_Tp>
972 template<
typename _Tp>
973 struct __is_nt_default_constructible_atom
977 template<typename _Tp, bool = is_array<_Tp>::value>
978 struct __is_nt_default_constructible_impl;
980 template<
typename _Tp>
981 struct __is_nt_default_constructible_impl<_Tp, true>
982 :
public __and_<__is_array_known_bounds<_Tp>,
983 __is_nt_default_constructible_atom<typename
984 remove_all_extents<_Tp>::type>>
987 template<
typename _Tp>
988 struct __is_nt_default_constructible_impl<_Tp, false>
989 :
public __is_nt_default_constructible_atom<_Tp>
993 template<
typename _Tp>
995 :
public __and_<is_default_constructible<_Tp>,
996 __is_nt_default_constructible_impl<_Tp>>
999 template<
typename _Tp,
typename... _Args>
1000 struct __is_nt_constructible_impl
1004 template<
typename _Tp,
typename _Arg>
1005 struct __is_nt_constructible_impl<_Tp, _Arg>
1007 noexcept(static_cast<_Tp>(declval<_Arg>()))>
1010 template<
typename _Tp>
1011 struct __is_nt_constructible_impl<_Tp>
1016 template<
typename _Tp,
typename... _Args>
1018 :
public __and_<is_constructible<_Tp, _Args...>,
1019 __is_nt_constructible_impl<_Tp, _Args...>>
1022 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1023 struct __is_nothrow_copy_constructible_impl;
1025 template<
typename _Tp>
1026 struct __is_nothrow_copy_constructible_impl<_Tp, false>
1027 :
public false_type { };
1029 template<
typename _Tp>
1030 struct __is_nothrow_copy_constructible_impl<_Tp, true>
1035 template<
typename _Tp>
1037 :
public __is_nothrow_copy_constructible_impl<_Tp>
1040 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1041 struct __is_nothrow_move_constructible_impl;
1043 template<
typename _Tp>
1044 struct __is_nothrow_move_constructible_impl<_Tp, false>
1045 :
public false_type { };
1047 template<
typename _Tp>
1048 struct __is_nothrow_move_constructible_impl<_Tp, true>
1053 template<
typename _Tp>
1055 :
public __is_nothrow_move_constructible_impl<_Tp>
1059 template<
typename _Tp,
typename _Up>
1061 :
public __bool_constant<__is_assignable(_Tp, _Up)>
1064 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1065 struct __is_copy_assignable_impl;
1067 template<
typename _Tp>
1068 struct __is_copy_assignable_impl<_Tp, false>
1069 :
public false_type { };
1071 template<
typename _Tp>
1072 struct __is_copy_assignable_impl<_Tp, true>
1077 template<
typename _Tp>
1079 :
public __is_copy_assignable_impl<_Tp>
1082 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1083 struct __is_move_assignable_impl;
1085 template<
typename _Tp>
1086 struct __is_move_assignable_impl<_Tp, false>
1087 :
public false_type { };
1089 template<
typename _Tp>
1090 struct __is_move_assignable_impl<_Tp, true>
1095 template<
typename _Tp>
1097 :
public __is_move_assignable_impl<_Tp>
1100 template<
typename _Tp,
typename _Up>
1101 struct __is_nt_assignable_impl
1106 template<
typename _Tp,
typename _Up>
1108 :
public __and_<is_assignable<_Tp, _Up>,
1109 __is_nt_assignable_impl<_Tp, _Up>>
1112 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1113 struct __is_nt_copy_assignable_impl;
1115 template<
typename _Tp>
1116 struct __is_nt_copy_assignable_impl<_Tp, false>
1117 :
public false_type { };
1119 template<
typename _Tp>
1120 struct __is_nt_copy_assignable_impl<_Tp, true>
1125 template<
typename _Tp>
1127 :
public __is_nt_copy_assignable_impl<_Tp>
1130 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1131 struct __is_nt_move_assignable_impl;
1133 template<
typename _Tp>
1134 struct __is_nt_move_assignable_impl<_Tp, false>
1135 :
public false_type { };
1137 template<
typename _Tp>
1138 struct __is_nt_move_assignable_impl<_Tp, true>
1143 template<
typename _Tp>
1145 :
public __is_nt_move_assignable_impl<_Tp>
1149 template<
typename _Tp,
typename... _Args>
1151 :
public __bool_constant<__is_trivially_constructible(_Tp, _Args...)>
1155 template<
typename _Tp>
1160 struct __do_is_implicitly_default_constructible_impl
1162 template <
typename _Tp>
1163 static void __helper(
const _Tp&);
1165 template <
typename _Tp>
1166 static true_type __test(
const _Tp&,
1167 decltype(__helper<const _Tp&>({}))* = 0);
1169 static false_type __test(...);
1172 template<
typename _Tp>
1173 struct __is_implicitly_default_constructible_impl
1174 :
public __do_is_implicitly_default_constructible_impl
1176 typedef decltype(__test(declval<_Tp>())) type;
1179 template<
typename _Tp>
1180 struct __is_implicitly_default_constructible_safe
1181 :
public __is_implicitly_default_constructible_impl<_Tp>::type
1184 template <
typename _Tp>
1185 struct __is_implicitly_default_constructible
1186 :
public __and_<is_default_constructible<_Tp>,
1187 __is_implicitly_default_constructible_safe<_Tp>>
1192 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1195 template<
typename _Tp>
1197 :
public false_type { };
1199 template<
typename _Tp>
1201 :
public __and_<is_copy_constructible<_Tp>,
1202 integral_constant<bool,
1203 __is_trivially_constructible(_Tp, const _Tp&)>>
1206 template<
typename _Tp>
1207 struct is_trivially_copy_constructible
1213 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1216 template<
typename _Tp>
1218 :
public false_type { };
1220 template<
typename _Tp>
1222 :
public __and_<is_move_constructible<_Tp>,
1223 integral_constant<bool,
1224 __is_trivially_constructible(_Tp, _Tp&&)>>
1227 template<
typename _Tp>
1228 struct is_trivially_move_constructible
1233 template<
typename _Tp,
typename _Up>
1235 :
public __bool_constant<__is_trivially_assignable(_Tp, _Up)>
1240 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1243 template<
typename _Tp>
1245 :
public false_type { };
1247 template<
typename _Tp>
1249 :
public __and_<is_copy_assignable<_Tp>,
1250 integral_constant<bool,
1251 __is_trivially_assignable(_Tp&, const _Tp&)>>
1254 template<
typename _Tp>
1255 struct is_trivially_copy_assignable
1261 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1264 template<
typename _Tp>
1266 :
public false_type { };
1268 template<
typename _Tp>
1270 :
public __and_<is_move_assignable<_Tp>,
1271 integral_constant<bool,
1272 __is_trivially_assignable(_Tp&, _Tp&&)>>
1275 template<
typename _Tp>
1276 struct is_trivially_move_assignable
1281 template<
typename _Tp>
1283 :
public __and_<is_destructible<_Tp>, integral_constant<bool,
1284 __has_trivial_destructor(_Tp)>>
1289 template<
typename _Tp>
1298 template<
typename _Tp>
1307 template<
typename _Tp, std::
size_t _Size>
1308 struct rank<_Tp[_Size]>
1311 template<
typename _Tp>
1316 template<
typename,
unsigned _U
int>
1320 template<
typename _Tp,
unsigned _U
int, std::
size_t _Size>
1321 struct extent<_Tp[_Size], _Uint>
1323 _Uint == 0 ? _Size : extent<_Tp,
1327 template<
typename _Tp,
unsigned _U
int>
1328 struct extent<_Tp[], _Uint>
1330 _Uint == 0 ? 0 : extent<_Tp,
1338 template<
typename,
typename>
1340 :
public false_type { };
1342 template<
typename _Tp>
1344 :
public true_type { };
1347 template<
typename _Base,
typename _Derived>
1352 template<
typename _From,
typename _To,
1355 struct __is_convertible_helper
1358 template<
typename _From,
typename _To>
1359 class __is_convertible_helper<_From, _To, false>
1361 template<
typename _To1>
1362 static void __test_aux(_To1);
1364 template<
typename _From1,
typename _To1,
1365 typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1369 template<
typename,
typename>
1374 typedef decltype(__test<_From, _To>(0))
type;
1379 template<
typename _From,
typename _To>
1381 :
public __is_convertible_helper<_From, _To>::type
1388 template<
typename _Tp>
1390 {
typedef _Tp type; };
1392 template<
typename _Tp>
1394 {
typedef _Tp type; };
1397 template<
typename _Tp>
1399 {
typedef _Tp type; };
1401 template<
typename _Tp>
1403 {
typedef _Tp type; };
1406 template<
typename _Tp>
1414 template<
typename _Tp>
1416 {
typedef _Tp
const type; };
1419 template<
typename _Tp>
1421 {
typedef _Tp
volatile type; };
1424 template<
typename _Tp>
1431 #if __cplusplus > 201103L 1433 #define __cpp_lib_transformation_trait_aliases 201304 1436 template<
typename _Tp>
1440 template<
typename _Tp>
1444 template<
typename _Tp>
1448 template<
typename _Tp>
1452 template<
typename _Tp>
1456 template<
typename _Tp>
1463 template<
typename _Tp>
1465 {
typedef _Tp type; };
1467 template<
typename _Tp>
1469 {
typedef _Tp type; };
1471 template<
typename _Tp>
1473 {
typedef _Tp type; };
1475 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1476 struct __add_lvalue_reference_helper
1477 {
typedef _Tp type; };
1479 template<
typename _Tp>
1480 struct __add_lvalue_reference_helper<_Tp, true>
1481 {
typedef _Tp& type; };
1484 template<
typename _Tp>
1486 :
public __add_lvalue_reference_helper<_Tp>
1489 template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1490 struct __add_rvalue_reference_helper
1491 {
typedef _Tp type; };
1493 template<
typename _Tp>
1494 struct __add_rvalue_reference_helper<_Tp, true>
1495 {
typedef _Tp&& type; };
1498 template<
typename _Tp>
1500 :
public __add_rvalue_reference_helper<_Tp>
1503 #if __cplusplus > 201103L 1505 template<
typename _Tp>
1509 template<
typename _Tp>
1513 template<
typename _Tp>
1520 template<
typename _Unqualified,
bool _IsConst,
bool _IsVol>
1521 struct __cv_selector;
1523 template<
typename _Unqualified>
1524 struct __cv_selector<_Unqualified, false, false>
1525 {
typedef _Unqualified __type; };
1527 template<
typename _Unqualified>
1528 struct __cv_selector<_Unqualified, false, true>
1529 {
typedef volatile _Unqualified __type; };
1531 template<
typename _Unqualified>
1532 struct __cv_selector<_Unqualified, true, false>
1533 {
typedef const _Unqualified __type; };
1535 template<
typename _Unqualified>
1536 struct __cv_selector<_Unqualified, true, true>
1537 {
typedef const volatile _Unqualified __type; };
1539 template<
typename _Qualified,
typename _Unqualified,
1542 class __match_cv_qualifiers
1544 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1547 typedef typename __match::__type __type;
1551 template<
typename _Tp>
1552 struct __make_unsigned
1553 {
typedef _Tp __type; };
1556 struct __make_unsigned<char>
1557 {
typedef unsigned char __type; };
1560 struct __make_unsigned<signed char>
1561 {
typedef unsigned char __type; };
1564 struct __make_unsigned<short>
1565 {
typedef unsigned short __type; };
1568 struct __make_unsigned<int>
1569 {
typedef unsigned int __type; };
1572 struct __make_unsigned<long>
1573 {
typedef unsigned long __type; };
1576 struct __make_unsigned<long long>
1577 {
typedef unsigned long long __type; };
1579 #if defined(_GLIBCXX_USE_WCHAR_T) && !defined(__WCHAR_UNSIGNED__) 1581 struct __make_unsigned<wchar_t> : __make_unsigned<__WCHAR_TYPE__>
1585 #if defined(__GLIBCXX_TYPE_INT_N_0) 1587 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_0>
1588 {
typedef unsigned __GLIBCXX_TYPE_INT_N_0 __type; };
1590 #if defined(__GLIBCXX_TYPE_INT_N_1) 1592 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_1>
1593 {
typedef unsigned __GLIBCXX_TYPE_INT_N_1 __type; };
1595 #if defined(__GLIBCXX_TYPE_INT_N_2) 1597 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_2>
1598 {
typedef unsigned __GLIBCXX_TYPE_INT_N_2 __type; };
1600 #if defined(__GLIBCXX_TYPE_INT_N_3) 1602 struct __make_unsigned<__GLIBCXX_TYPE_INT_N_3>
1603 {
typedef unsigned __GLIBCXX_TYPE_INT_N_3 __type; };
1607 template<
typename _Tp,
1610 class __make_unsigned_selector;
1612 template<
typename _Tp>
1613 class __make_unsigned_selector<_Tp, true, false>
1615 typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1616 typedef typename __unsignedt::__type __unsigned_type;
1617 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1620 typedef typename __cv_unsigned::__type __type;
1623 template<
typename _Tp>
1624 class __make_unsigned_selector<_Tp, false, true>
1627 typedef unsigned char __smallest;
1628 static const bool __b0 =
sizeof(_Tp) <=
sizeof(__smallest);
1629 static const bool __b1 =
sizeof(_Tp) <=
sizeof(
unsigned short);
1630 static const bool __b2 =
sizeof(_Tp) <=
sizeof(
unsigned int);
1631 static const bool __b3 =
sizeof(_Tp) <=
sizeof(
unsigned long);
1633 typedef typename __cond3::type __cond3_type;
1635 typedef typename __cond2::type __cond2_type;
1637 typedef typename __cond1::type __cond1_type;
1639 typedef typename conditional<__b0, __smallest, __cond1_type>::type
1641 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1644 typedef typename __cv_unsigned::__type __type;
1651 template<
typename _Tp>
1653 {
typedef typename __make_unsigned_selector<_Tp>::__type type; };
1661 template<
typename _Tp>
1662 struct __make_signed
1663 {
typedef _Tp __type; };
1666 struct __make_signed<char>
1667 {
typedef signed char __type; };
1670 struct __make_signed<unsigned char>
1671 {
typedef signed char __type; };
1674 struct __make_signed<unsigned short>
1675 {
typedef signed short __type; };
1678 struct __make_signed<unsigned int>
1679 {
typedef signed int __type; };
1682 struct __make_signed<unsigned long>
1683 {
typedef signed long __type; };
1686 struct __make_signed<unsigned long long>
1687 {
typedef signed long long __type; };
1689 #if defined(_GLIBCXX_USE_WCHAR_T) && defined(__WCHAR_UNSIGNED__) 1691 struct __make_signed<wchar_t> : __make_signed<__WCHAR_TYPE__>
1695 #ifdef _GLIBCXX_USE_C99_STDINT_TR1 1697 struct __make_signed<char16_t> : __make_signed<uint_least16_t>
1700 struct __make_signed<char32_t> : __make_signed<uint_least32_t>
1704 #if defined(__GLIBCXX_TYPE_INT_N_0) 1706 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_0>
1707 {
typedef __GLIBCXX_TYPE_INT_N_0 __type; };
1709 #if defined(__GLIBCXX_TYPE_INT_N_1) 1711 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_1>
1712 {
typedef __GLIBCXX_TYPE_INT_N_1 __type; };
1714 #if defined(__GLIBCXX_TYPE_INT_N_2) 1716 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_2>
1717 {
typedef __GLIBCXX_TYPE_INT_N_2 __type; };
1719 #if defined(__GLIBCXX_TYPE_INT_N_3) 1721 struct __make_signed<unsigned __GLIBCXX_TYPE_INT_N_3>
1722 {
typedef __GLIBCXX_TYPE_INT_N_3 __type; };
1726 template<
typename _Tp,
1729 class __make_signed_selector;
1731 template<
typename _Tp>
1732 class __make_signed_selector<_Tp, true, false>
1734 typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1735 typedef typename __signedt::__type __signed_type;
1736 typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1739 typedef typename __cv_signed::__type __type;
1742 template<
typename _Tp>
1743 class __make_signed_selector<_Tp, false, true>
1745 typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type;
1748 typedef typename __make_signed_selector<__unsigned_type>::__type __type;
1755 template<
typename _Tp>
1757 {
typedef typename __make_signed_selector<_Tp>::__type type; };
1763 #if __cplusplus > 201103L 1765 template<
typename _Tp>
1769 template<
typename _Tp>
1776 template<
typename _Tp>
1778 {
typedef _Tp type; };
1780 template<
typename _Tp, std::
size_t _Size>
1782 {
typedef _Tp type; };
1784 template<
typename _Tp>
1786 {
typedef _Tp type; };
1789 template<
typename _Tp>
1791 {
typedef _Tp type; };
1793 template<
typename _Tp, std::
size_t _Size>
1795 {
typedef typename remove_all_extents<_Tp>::type type; };
1797 template<
typename _Tp>
1799 {
typedef typename remove_all_extents<_Tp>::type type; };
1801 #if __cplusplus > 201103L 1803 template<
typename _Tp>
1807 template<
typename _Tp>
1813 template<
typename _Tp,
typename>
1814 struct __remove_pointer_helper
1815 {
typedef _Tp type; };
1817 template<
typename _Tp,
typename _Up>
1818 struct __remove_pointer_helper<_Tp, _Up*>
1819 {
typedef _Up type; };
1822 template<
typename _Tp>
1824 :
public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1828 template<
typename _Tp,
bool = __or_<__is_referenceable<_Tp>,
1829 is_
void<_Tp>>::value>
1831 {
typedef _Tp type; };
1833 template<
typename _Tp>
1835 {
typedef typename remove_reference<_Tp>::type* type; };
1837 template<
typename _Tp>
1842 #if __cplusplus > 201103L 1844 template<
typename _Tp>
1848 template<
typename _Tp>
1852 template<std::
size_t _Len>
1853 struct __aligned_storage_msa
1857 unsigned char __data[_Len];
1858 struct __attribute__((__aligned__)) { } __align;
1872 template<std::size_t _Len, std::size_t _Align =
1873 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
1878 unsigned char __data[_Len];
1879 struct __attribute__((__aligned__((_Align)))) { } __align;
1883 template <
typename... _Types>
1884 struct __strictest_alignment
1886 static const size_t _S_alignment = 0;
1887 static const size_t _S_size = 0;
1890 template <
typename _Tp,
typename... _Types>
1891 struct __strictest_alignment<_Tp, _Types...>
1893 static const size_t _S_alignment =
1894 alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment
1895 ?
alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment;
1896 static const size_t _S_size =
1897 sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size
1898 ?
sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size;
1911 template <
size_t _Len,
typename... _Types>
1915 static_assert(
sizeof...(_Types) != 0,
"At least one type is required");
1917 using __strictest = __strictest_alignment<_Types...>;
1918 static const size_t _S_len = _Len > __strictest::_S_size
1919 ? _Len : __strictest::_S_size;
1922 static const size_t alignment_value = __strictest::_S_alignment;
1927 template <
size_t _Len,
typename... _Types>
1928 const size_t aligned_union<_Len, _Types...>::alignment_value;
1932 template<
typename _Up,
1935 struct __decay_selector;
1938 template<
typename _Up>
1939 struct __decay_selector<_Up, false, false>
1940 {
typedef typename remove_cv<_Up>::type __type; };
1942 template<
typename _Up>
1943 struct __decay_selector<_Up, true, false>
1944 {
typedef typename remove_extent<_Up>::type* __type; };
1946 template<
typename _Up>
1947 struct __decay_selector<_Up, false, true>
1948 {
typedef typename add_pointer<_Up>::type __type; };
1951 template<
typename _Tp>
1954 typedef typename remove_reference<_Tp>::type __remove_type;
1957 typedef typename __decay_selector<__remove_type>::__type type;
1960 template<
typename _Tp>
1964 template<
typename _Tp>
1965 struct __strip_reference_wrapper
1970 template<
typename _Tp>
1973 typedef _Tp& __type;
1976 template<
typename _Tp>
1977 struct __decay_and_strip
1979 typedef typename __strip_reference_wrapper<
1980 typename decay<_Tp>::type>::__type __type;
1986 template<
bool,
typename _Tp =
void>
1991 template<
typename _Tp>
1993 {
typedef _Tp type; };
1995 template<
typename... _Cond>
1996 using _Require =
typename enable_if<__and_<_Cond...>::value>::type;
2000 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2002 {
typedef _Iftrue type; };
2005 template<
typename _Iftrue,
typename _Iffalse>
2007 {
typedef _Iffalse type; };
2010 template<
typename... _Tp>
2015 struct __do_common_type_impl
2017 template<
typename _Tp,
typename _Up>
2018 static __success_type<
typename decay<decltype
2019 (
true ? std::declval<_Tp>()
2020 : std::declval<_Up>())>::type> _S_test(
int);
2022 template<
typename,
typename>
2023 static __failure_type _S_test(...);
2026 template<
typename _Tp,
typename _Up>
2027 struct __common_type_impl
2028 :
private __do_common_type_impl
2030 typedef decltype(_S_test<_Tp, _Up>(0)) type;
2033 struct __do_member_type_wrapper
2035 template<
typename _Tp>
2036 static __success_type<typename _Tp::type> _S_test(
int);
2039 static __failure_type _S_test(...);
2042 template<
typename _Tp>
2043 struct __member_type_wrapper
2044 :
private __do_member_type_wrapper
2046 typedef decltype(_S_test<_Tp>(0)) type;
2049 template<typename _CTp, typename... _Args>
2050 struct __expanded_common_type_wrapper
2052 typedef common_type<
typename _CTp::type, _Args...> type;
2055 template<
typename... _Args>
2056 struct __expanded_common_type_wrapper<__failure_type, _Args...>
2057 {
typedef __failure_type type; };
2059 template<
typename _Tp>
2061 {
typedef typename decay<_Tp>::type type; };
2063 template<
typename _Tp,
typename _Up>
2065 :
public __common_type_impl<_Tp, _Up>::type
2068 template<
typename _Tp,
typename _Up,
typename... _Vp>
2070 :
public __expanded_common_type_wrapper<typename __member_type_wrapper<
2071 common_type<_Tp, _Up>>::type, _Vp...>::type
2075 template<
typename _Tp>
2078 typedef __underlying_type(_Tp) type;
2081 template<
typename _Tp>
2082 struct __declval_protector
2084 static const bool __stop =
false;
2087 template<
typename _Tp>
2088 auto declval() noexcept -> decltype(__declval<_Tp>(0))
2090 static_assert(__declval_protector<_Tp>::__stop,
2091 "declval() must not be used!");
2092 return __declval<_Tp>(0);
2096 template<
typename _Signature>
2101 #define __cpp_lib_result_of_sfinae 201210 2103 struct __invoke_memfun_ref { };
2104 struct __invoke_memfun_deref { };
2105 struct __invoke_memobj_ref { };
2106 struct __invoke_memobj_deref { };
2107 struct __invoke_other { };
2110 template<
typename _Tp,
typename _Tag>
2111 struct __result_of_success : __success_type<_Tp>
2112 {
using __invoke_type = _Tag; };
2115 struct __result_of_memfun_ref_impl
2117 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2118 static __result_of_success<decltype(
2119 (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2120 ), __invoke_memfun_ref> _S_test(
int);
2122 template<
typename...>
2123 static __failure_type _S_test(...);
2126 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2127 struct __result_of_memfun_ref
2128 :
private __result_of_memfun_ref_impl
2130 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2134 struct __result_of_memfun_deref_impl
2136 template<
typename _Fp,
typename _Tp1,
typename... _Args>
2137 static __result_of_success<decltype(
2138 ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2139 ), __invoke_memfun_deref> _S_test(
int);
2141 template<
typename...>
2142 static __failure_type _S_test(...);
2145 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2146 struct __result_of_memfun_deref
2147 :
private __result_of_memfun_deref_impl
2149 typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2153 struct __result_of_memobj_ref_impl
2155 template<
typename _Fp,
typename _Tp1>
2156 static __result_of_success<decltype(
2157 std::declval<_Tp1>().*std::declval<_Fp>()
2158 ), __invoke_memobj_ref> _S_test(
int);
2160 template<
typename,
typename>
2161 static __failure_type _S_test(...);
2164 template<
typename _MemPtr,
typename _Arg>
2165 struct __result_of_memobj_ref
2166 :
private __result_of_memobj_ref_impl
2168 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2172 struct __result_of_memobj_deref_impl
2174 template<
typename _Fp,
typename _Tp1>
2175 static __result_of_success<decltype(
2176 (*std::declval<_Tp1>()).*std::declval<_Fp>()
2177 ), __invoke_memobj_deref> _S_test(
int);
2179 template<
typename,
typename>
2180 static __failure_type _S_test(...);
2183 template<
typename _MemPtr,
typename _Arg>
2184 struct __result_of_memobj_deref
2185 :
private __result_of_memobj_deref_impl
2187 typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2190 template<typename _MemPtr, typename _Arg>
2191 struct __result_of_memobj;
2193 template<typename _Res, typename _Class, typename _Arg>
2194 struct __result_of_memobj<_Res _Class::*, _Arg>
2197 _Arg>::type>::type _Argval;
2198 typedef _Res _Class::* _MemPtr;
2201 __result_of_memobj_ref<_MemPtr, _Arg>,
2202 __result_of_memobj_deref<_MemPtr, _Arg>
2206 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2207 struct __result_of_memfun;
2209 template<
typename _Res,
typename _Class,
typename _Arg,
typename... _Args>
2210 struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2213 _Arg>::type>::type _Argval;
2214 typedef _Res _Class::* _MemPtr;
2217 __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2218 __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2227 template<typename _Tp, typename _Up = typename decay<_Tp>::type>
2233 template<
typename _Tp,
typename _Up>
2239 template<bool, bool,
typename _Functor,
typename... _ArgTypes>
2240 struct __result_of_impl
2242 typedef __failure_type type;
2245 template<
typename _MemPtr,
typename _Arg>
2246 struct __result_of_impl<true, false, _MemPtr, _Arg>
2247 :
public __result_of_memobj<typename decay<_MemPtr>::type,
2248 typename __inv_unwrap<_Arg>::type>
2251 template<
typename _MemPtr,
typename _Arg,
typename... _Args>
2252 struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2253 :
public __result_of_memfun<typename decay<_MemPtr>::type,
2254 typename __inv_unwrap<_Arg>::type, _Args...>
2258 struct __result_of_other_impl
2260 template<
typename _Fn,
typename... _Args>
2261 static __result_of_success<decltype(
2262 std::declval<_Fn>()(std::declval<_Args>()...)
2263 ), __invoke_other> _S_test(
int);
2265 template<
typename...>
2266 static __failure_type _S_test(...);
2269 template<
typename _Functor,
typename... _ArgTypes>
2270 struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2271 :
private __result_of_other_impl
2273 typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2277 template<typename _Functor, typename... _ArgTypes>
2278 struct __invoke_result
2279 : public __result_of_impl<
2286 _Functor, _ArgTypes...
2290 template<
typename _Functor,
typename... _ArgTypes>
2291 struct result_of<_Functor(_ArgTypes...)>
2292 :
public __invoke_result<_Functor, _ArgTypes...>
2295 #if __cplusplus > 201103L 2297 template<
size_t _Len,
size_t _Align =
2298 __alignof__(
typename __aligned_storage_msa<_Len>::__type)>
2301 template <
size_t _Len,
typename... _Types>
2302 using aligned_union_t =
typename aligned_union<_Len, _Types...>::type;
2305 template<
typename _Tp>
2309 template<
bool _Cond,
typename _Tp =
void>
2313 template<
bool _Cond,
typename _Iftrue,
typename _Iffalse>
2317 template<
typename... _Tp>
2321 template<
typename _Tp>
2325 template<
typename _Tp>
2329 template<
typename...>
using __void_t = void;
2331 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 2332 #define __cpp_lib_void_t 201411 2338 template<
typename _Default,
typename _AlwaysVoid,
2339 template<
typename...>
class _Op,
typename... _Args>
2343 using type = _Default;
2347 template<
typename _Default,
template<
typename...>
class _Op,
2349 struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...>
2352 using type = _Op<_Args...>;
2356 template<
typename _Default,
template<
typename...>
class _Op,
2361 template<
typename _Default,
template<
typename...>
class _Op,
2363 using __detected_or_t
2364 =
typename __detected_or<_Default, _Op, _Args...>::type;
2372 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \ 2373 template<typename _Tp, typename = __void_t<>> \ 2374 struct __has_##_NTYPE \ 2377 template<typename _Tp> \ 2378 struct __has_##_NTYPE<_Tp, __void_t<typename _Tp::_NTYPE>> \ 2382 template <
typename _Tp>
2383 struct __is_swappable;
2385 template <
typename _Tp>
2386 struct __is_nothrow_swappable;
2388 template<
typename... _Elements>
2392 struct __is_tuple_like_impl : false_type
2395 template<
typename... _Tps>
2396 struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
2400 template<
typename _Tp>
2401 struct __is_tuple_like
2402 :
public __is_tuple_like_impl<typename remove_cv<
2403 typename remove_reference<_Tp>::type>::type>::type
2406 template<
typename _Tp>
2408 typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>,
2409 is_move_constructible<_Tp>,
2410 is_move_assignable<_Tp>>::value>::type
2412 noexcept(__and_<is_nothrow_move_constructible<_Tp>,
2413 is_nothrow_move_assignable<_Tp>>::value);
2415 template<
typename _Tp,
size_t _Nm>
2417 typename enable_if<__is_swappable<_Tp>::value>::type
2418 swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
2419 noexcept(__is_nothrow_swappable<_Tp>::value);
2421 namespace __swappable_details {
2424 struct __do_is_swappable_impl
2426 template<
typename _Tp,
typename 2427 = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))>
2428 static true_type __test(
int);
2431 static false_type __test(...);
2434 struct __do_is_nothrow_swappable_impl
2436 template<
typename _Tp>
2437 static __bool_constant<
2438 noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))
2442 static false_type __test(...);
2447 template<
typename _Tp>
2448 struct __is_swappable_impl
2449 :
public __swappable_details::__do_is_swappable_impl
2451 typedef decltype(__test<_Tp>(0)) type;
2454 template<typename _Tp>
2455 struct __is_nothrow_swappable_impl
2456 : public __swappable_details::__do_is_nothrow_swappable_impl
2458 typedef decltype(__test<_Tp>(0)) type;
2461 template<typename _Tp>
2462 struct __is_swappable
2463 : public __is_swappable_impl<_Tp>::type
2466 template<
typename _Tp>
2467 struct __is_nothrow_swappable
2468 :
public __is_nothrow_swappable_impl<_Tp>::type
2471 #if __cplusplus > 201402L || !defined(__STRICT_ANSI__) // c++1z or gnu++11 2472 #define __cpp_lib_is_swappable 201603 2476 template<
typename _Tp>
2478 :
public __is_swappable_impl<_Tp>::type
2482 template<
typename _Tp>
2484 :
public __is_nothrow_swappable_impl<_Tp>::type
2487 #if __cplusplus >= 201402L 2489 template<
typename _Tp>
2494 template<
typename _Tp>
2497 #endif // __cplusplus >= 201402L 2499 namespace __swappable_with_details {
2502 struct __do_is_swappable_with_impl
2504 template<
typename _Tp,
typename _Up,
typename 2505 = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())),
2507 = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))>
2508 static true_type __test(
int);
2510 template<
typename,
typename>
2511 static false_type __test(...);
2514 struct __do_is_nothrow_swappable_with_impl
2516 template<
typename _Tp,
typename _Up>
2517 static __bool_constant<
2518 noexcept(swap(std::declval<_Tp>(), std::declval<_Up>()))
2520 noexcept(swap(std::declval<_Up>(), std::declval<_Tp>()))
2523 template<
typename,
typename>
2524 static false_type __test(...);
2529 template<
typename _Tp,
typename _Up>
2530 struct __is_swappable_with_impl
2531 :
public __swappable_with_details::__do_is_swappable_with_impl
2533 typedef decltype(__test<_Tp, _Up>(0)) type;
2537 template<
typename _Tp>
2538 struct __is_swappable_with_impl<_Tp&, _Tp&>
2539 :
public __swappable_details::__do_is_swappable_impl
2541 typedef decltype(__test<_Tp&>(0)) type;
2544 template<
typename _Tp,
typename _Up>
2545 struct __is_nothrow_swappable_with_impl
2546 :
public __swappable_with_details::__do_is_nothrow_swappable_with_impl
2548 typedef decltype(__test<_Tp, _Up>(0)) type;
2552 template<
typename _Tp>
2553 struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&>
2554 :
public __swappable_details::__do_is_nothrow_swappable_impl
2556 typedef decltype(__test<_Tp&>(0)) type;
2560 template<
typename _Tp,
typename _Up>
2562 :
public __is_swappable_with_impl<_Tp, _Up>::type
2566 template<
typename _Tp,
typename _Up>
2568 :
public __is_nothrow_swappable_with_impl<_Tp, _Up>::type
2571 #if __cplusplus >= 201402L 2573 template<
typename _Tp,
typename _Up>
2578 template<
typename _Tp,
typename _Up>
2581 #endif // __cplusplus >= 201402L 2583 #endif// c++1z or gnu++11 2587 template<
typename _Result,
typename _Ret,
typename =
void>
2588 struct __is_invocable_impl : false_type { };
2590 template<
typename _Result,
typename _Ret>
2591 struct __is_invocable_impl<_Result, _Ret, __void_t<typename _Result::type>>
2592 : __or_<is_void<_Ret>, is_convertible<typename _Result::type, _Ret>>::type
2595 template<
typename _Fn,
typename... _ArgTypes>
2596 struct __is_invocable
2597 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2600 template<
typename _Fn,
typename _Tp,
typename... _Args>
2601 constexpr
bool __call_is_nt(__invoke_memfun_ref)
2603 using _Up =
typename __inv_unwrap<_Tp>::type;
2604 return noexcept((std::declval<_Up>().*std::declval<_Fn>())(
2605 std::declval<_Args>()...));
2608 template<
typename _Fn,
typename _Tp,
typename... _Args>
2609 constexpr
bool __call_is_nt(__invoke_memfun_deref)
2611 return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())(
2612 std::declval<_Args>()...));
2615 template<
typename _Fn,
typename _Tp>
2616 constexpr
bool __call_is_nt(__invoke_memobj_ref)
2618 using _Up =
typename __inv_unwrap<_Tp>::type;
2619 return noexcept(std::declval<_Up>().*std::declval<_Fn>());
2622 template<
typename _Fn,
typename _Tp>
2623 constexpr
bool __call_is_nt(__invoke_memobj_deref)
2625 return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>());
2628 template<
typename _Fn,
typename... _Args>
2629 constexpr
bool __call_is_nt(__invoke_other)
2631 return noexcept(std::declval<_Fn>()(std::declval<_Args>()...));
2634 template<
typename _Result,
typename _Fn,
typename... _Args>
2635 struct __call_is_nothrow
2637 std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{})
2641 template<
typename _Fn,
typename... _Args>
2642 using __call_is_nothrow_
2643 = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>;
2646 template<
typename _Fn,
typename... _Args>
2647 struct __is_nothrow_invocable
2648 : __and_<__is_invocable<_Fn, _Args...>,
2649 __call_is_nothrow_<_Fn, _Args...>>::type
2653 __nonesuch() =
delete;
2654 ~__nonesuch() =
delete;
2655 __nonesuch(__nonesuch
const&) =
delete;
2656 void operator=(__nonesuch
const&) =
delete;
2659 #if __cplusplus >= 201703L 2660 # define __cpp_lib_is_invocable 201703 2663 template<
typename _Functor,
typename... _ArgTypes>
2664 struct invoke_result
2665 :
public __invoke_result<_Functor, _ArgTypes...>
2669 template<
typename _Fn,
typename... _Args>
2670 using invoke_result_t =
typename invoke_result<_Fn, _Args...>::type;
2673 template<
typename _Fn,
typename... _ArgTypes>
2675 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type
2679 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2680 struct is_invocable_r
2681 : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>::type
2685 template<
typename _Fn,
typename... _ArgTypes>
2686 struct is_nothrow_invocable
2687 : __and_<__is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>,
2688 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2691 template<
typename _Result,
typename _Ret,
typename =
void>
2692 struct __is_nt_invocable_impl : false_type { };
2694 template<
typename _Result,
typename _Ret>
2695 struct __is_nt_invocable_impl<_Result, _Ret,
2696 __void_t<typename _Result::type>>
2697 : __or_<is_void<_Ret>,
2698 __and_<is_convertible<typename _Result::type, _Ret>,
2699 is_nothrow_constructible<_Ret, typename _Result::type>>>
2703 template<
typename _Ret,
typename _Fn,
typename... _ArgTypes>
2704 struct is_nothrow_invocable_r
2705 : __and_<__is_nt_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, _Ret>,
2706 __call_is_nothrow_<_Fn, _ArgTypes...>>::type
2710 template<
typename _Fn,
typename... _Args>
2711 inline constexpr
bool is_invocable_v = is_invocable<_Fn, _Args...>::value;
2714 template<
typename _Fn,
typename... _Args>
2715 inline constexpr
bool is_nothrow_invocable_v
2716 = is_nothrow_invocable<_Fn, _Args...>::value;
2719 template<
typename _Fn,
typename... _Args>
2720 inline constexpr
bool is_invocable_r_v
2721 = is_invocable_r<_Fn, _Args...>::value;
2724 template<
typename _Fn,
typename... _Args>
2725 inline constexpr
bool is_nothrow_invocable_r_v
2726 = is_nothrow_invocable_r<_Fn, _Args...>::value;
2729 #if __cplusplus >= 201703L 2730 # define __cpp_lib_type_trait_variable_templates 201510L 2731 template <
typename _Tp>
2733 template <
typename _Tp>
2735 template <
typename _Tp>
2737 template <
typename _Tp>
2739 template <
typename _Tp>
2741 template <
typename _Tp>
2743 template <
typename _Tp>
2744 inline constexpr
bool is_lvalue_reference_v =
2746 template <
typename _Tp>
2747 inline constexpr
bool is_rvalue_reference_v =
2749 template <
typename _Tp>
2750 inline constexpr
bool is_member_object_pointer_v =
2752 template <
typename _Tp>
2753 inline constexpr
bool is_member_function_pointer_v =
2755 template <
typename _Tp>
2757 template <
typename _Tp>
2759 template <
typename _Tp>
2761 template <
typename _Tp>
2763 template <
typename _Tp>
2765 template <
typename _Tp>
2767 template <
typename _Tp>
2769 template <
typename _Tp>
2771 template <
typename _Tp>
2773 template <
typename _Tp>
2775 template <
typename _Tp>
2777 template <
typename _Tp>
2779 template <
typename _Tp>
2781 template <
typename _Tp>
2783 template <
typename _Tp>
2784 inline constexpr
bool is_trivially_copyable_v =
2785 is_trivially_copyable<_Tp>::value;
2786 template <
typename _Tp>
2788 template <
typename _Tp>
2790 template <
typename _Tp>
2792 template <
typename _Tp>
2794 template <
typename _Tp>
2796 template <
typename _Tp>
2798 template <
typename _Tp>
2800 template <
typename _Tp>
2801 inline constexpr
bool is_signed_v = is_signed<_Tp>::value;
2802 template <
typename _Tp>
2803 inline constexpr
bool is_unsigned_v = is_unsigned<_Tp>::value;
2804 template <
typename _Tp,
typename... _Args>
2805 inline constexpr
bool is_constructible_v =
2807 template <
typename _Tp>
2808 inline constexpr
bool is_default_constructible_v =
2810 template <
typename _Tp>
2811 inline constexpr
bool is_copy_constructible_v =
2813 template <
typename _Tp>
2814 inline constexpr
bool is_move_constructible_v =
2816 template <
typename _Tp,
typename _Up>
2818 template <
typename _Tp>
2820 template <
typename _Tp>
2822 template <
typename _Tp>
2824 template <
typename _Tp,
typename... _Args>
2825 inline constexpr
bool is_trivially_constructible_v =
2827 template <
typename _Tp>
2828 inline constexpr
bool is_trivially_default_constructible_v =
2830 template <
typename _Tp>
2831 inline constexpr
bool is_trivially_copy_constructible_v =
2832 is_trivially_copy_constructible<_Tp>::value;
2833 template <
typename _Tp>
2834 inline constexpr
bool is_trivially_move_constructible_v =
2835 is_trivially_move_constructible<_Tp>::value;
2836 template <
typename _Tp,
typename _Up>
2837 inline constexpr
bool is_trivially_assignable_v =
2839 template <
typename _Tp>
2840 inline constexpr
bool is_trivially_copy_assignable_v =
2841 is_trivially_copy_assignable<_Tp>::value;
2842 template <
typename _Tp>
2843 inline constexpr
bool is_trivially_move_assignable_v =
2844 is_trivially_move_assignable<_Tp>::value;
2845 template <
typename _Tp>
2846 inline constexpr
bool is_trivially_destructible_v =
2848 template <
typename _Tp,
typename... _Args>
2849 inline constexpr
bool is_nothrow_constructible_v =
2851 template <
typename _Tp>
2852 inline constexpr
bool is_nothrow_default_constructible_v =
2854 template <
typename _Tp>
2855 inline constexpr
bool is_nothrow_copy_constructible_v =
2857 template <
typename _Tp>
2858 inline constexpr
bool is_nothrow_move_constructible_v =
2860 template <
typename _Tp,
typename _Up>
2861 inline constexpr
bool is_nothrow_assignable_v =
2863 template <
typename _Tp>
2864 inline constexpr
bool is_nothrow_copy_assignable_v =
2866 template <
typename _Tp>
2867 inline constexpr
bool is_nothrow_move_assignable_v =
2869 template <
typename _Tp>
2870 inline constexpr
bool is_nothrow_destructible_v =
2872 template <
typename _Tp>
2873 inline constexpr
bool has_virtual_destructor_v =
2875 template <
typename _Tp>
2877 template <
typename _Tp>
2879 template <
typename _Tp,
unsigned _Idx = 0>
2881 template <
typename _Tp,
typename _Up>
2883 template <
typename _Base,
typename _Derived>
2885 template <
typename _From,
typename _To>
2889 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 2890 #elif defined(__is_identifier) 2892 # if ! __is_identifier(__has_unique_object_representations) 2893 # define _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 1 2897 #ifdef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 2898 # define __cpp_lib_has_unique_object_representations 201606 2900 template<
typename _Tp>
2901 struct has_unique_object_representations
2902 : bool_constant<__has_unique_object_representations(
2903 remove_cv_t<remove_all_extents_t<_Tp>>
2907 template<
typename _Tp>
2908 inline constexpr
bool has_unique_object_representations_v
2909 = has_unique_object_representations<_Tp>::value;
2911 #undef _GLIBCXX_HAVE_BUILTIN_HAS_UNIQ_OBJ_REP 2914 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 2915 #elif defined(__is_identifier) 2917 # if ! __is_identifier(__is_aggregate) 2918 # define _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 1 2922 #ifdef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 2923 #define __cpp_lib_is_aggregate 201703 2925 template<
typename _Tp>
2927 : bool_constant<__is_aggregate(remove_cv_t<_Tp>)> { };
2930 template<
typename _Tp>
2931 inline constexpr
bool is_aggregate_v = is_aggregate<_Tp>::value;
2933 #undef _GLIBCXX_HAVE_BUILTIN_IS_AGGREGATE 2937 #if __cplusplus > 201703L 2941 little = __ORDER_LITTLE_ENDIAN__,
2942 big = __ORDER_BIG_ENDIAN__,
2943 native = __BYTE_ORDER__
2947 _GLIBCXX_END_NAMESPACE_VERSION
2952 #endif // _GLIBCXX_TYPE_TRAITS
typename remove_volatile< _Tp >::type remove_volatile_t
Alias template for remove_volatile.
typename add_const< _Tp >::type add_const_t
Alias template for add_const.
Define a member typedef type only if a boolean constant is true.
typename underlying_type< _Tp >::type underlying_type_t
Alias template for underlying_type.
is_member_function_pointer
typename conditional< _Cond, _Iftrue, _Iffalse >::type conditional_t
Alias template for conditional.
typename remove_all_extents< _Tp >::type remove_all_extents_t
Alias template for remove_all_extents.
is_trivially_move_assignable
void void_t
A metafunction that always yields void, used for detecting valid types.
Define a member typedef type to one of two argument types.
typename add_rvalue_reference< _Tp >::type add_rvalue_reference_t
Alias template for add_rvalue_reference.
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
is_null_pointer (LWG 2247).
typename add_volatile< _Tp >::type add_volatile_t
Alias template for add_volatile.
is_nothrow_move_assignable
_GLIBCXX17_INLINE constexpr bool is_nothrow_swappable_v
is_nothrow_swappable_v
is_nothrow_swappable_with
The underlying type of an enum.
typename add_lvalue_reference< _Tp >::type add_lvalue_reference_t
Alias template for add_lvalue_reference.
typename common_type< _Tp... >::type common_type_t
Alias template for common_type.
Implementation of the detection idiom (negative case).
is_trivially_default_constructible
is_nothrow_copy_constructible
Provide aligned storage for types.
typename make_signed< _Tp >::type make_signed_t
Alias template for make_signed.
typename aligned_storage< _Len, _Align >::type aligned_storage_t
Alias template for aligned_storage.
aligned_storage< _S_len, alignment_value >::type type
The storage.
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
typename remove_pointer< _Tp >::type remove_pointer_t
Alias template for remove_pointer.
ISO C++ entities toplevel namespace is std.
typename decay< _Tp >::type decay_t
Alias template for decay.
is_nothrow_move_constructible
typename remove_extent< _Tp >::type remove_extent_t
Alias template for remove_extent.
typename make_unsigned< _Tp >::type make_unsigned_t
Alias template for make_unsigned.
typename add_pointer< _Tp >::type add_pointer_t
Alias template for add_pointer.
typename remove_reference< _Tp >::type remove_reference_t
Alias template for remove_reference.
typename remove_const< _Tp >::type remove_const_t
Alias template for remove_const.
is_trivially_move_constructible
typename enable_if< _Cond, _Tp >::type enable_if_t
Alias template for enable_if.
typename result_of< _Tp >::type result_of_t
Alias template for result_of.
is_nothrow_default_constructible
typename add_cv< _Tp >::type add_cv_t
Alias template for add_cv.
is_trivially_copy_assignable
Metafunctions used for detecting swappable types: p0185r1.
_GLIBCXX17_INLINE constexpr bool is_nothrow_swappable_with_v
is_nothrow_swappable_with_v
_GLIBCXX17_INLINE constexpr bool is_swappable_with_v
is_swappable_with_v
is_trivially_destructible
is_nothrow_copy_assignable
Primary class template for reference_wrapper.
_GLIBCXX17_INLINE constexpr bool is_swappable_v
is_swappable_v
__is_nullptr_t (extension).
typename remove_cv< _Tp >::type remove_cv_t
Alias template for remove_cv.
is_trivially_constructible
is_trivially_copy_constructible