129
129
template <class T> struct alignment_of;
130
130
template <size_t Len, size_t Align = most_stringent_alignment_requirement>
131
131
struct aligned_storage;
132
template <size_t Len, class... Types> struct aligned_union;
133
134
template <class T> struct decay;
134
135
template <class... T> struct common_type;
136
137
template <class> class result_of; // undefined
137
138
template <class Fn, class... ArgTypes> class result_of<Fn(ArgTypes...)>;
140
// const-volatile modifications:
142
using remove_const_t = typename remove_const<T>::type; // C++14
144
using remove_volatile_t = typename remove_volatile<T>::type; // C++14
146
using remove_cv_t = typename remove_cv<T>::type; // C++14
148
using add_const_t = typename add_const<T>::type; // C++14
150
using add_volatile_t = typename add_volatile<T>::type; // C++14
152
using add_cv_t = typename add_cv<T>::type; // C++14
154
// reference modifications:
156
using remove_reference_t = typename remove_reference<T>::type; // C++14
158
using add_lvalue_reference_t = typename add_lvalue_reference<T>::type; // C++14
160
using add_rvalue_reference_t = typename add_rvalue_reference<T>::type; // C++14
162
// sign modifications:
164
using make_signed_t = typename make_signed<T>::type; // C++14
166
using make_unsigned_t = typename make_unsigned<T>::type; // C++14
168
// array modifications:
170
using remove_extent_t = typename remove_extent<T>::type; // C++14
172
using remove_all_extents_t = typename remove_all_extents<T>::type; // C++14
174
// pointer modifications:
176
using remove_pointer_t = typename remove_pointer<T>::type; // C++14
178
using add_pointer_t = typename add_pointer<T>::type; // C++14
180
// other transformations:
181
template <size_t Len, std::size_t Align=default-alignment>
182
using aligned_storage_t = typename aligned_storage<Len,Align>::type; // C++14
183
template <std::size_t Len, class... Types>
184
using aligned_union_t = typename aligned_union<Len,Types...>::type; // C++14
186
using decay_t = typename decay<T>::type; // C++14
187
template <bool b, class T=void>
188
using enable_if_t = typename enable_if<b,T>::type; // C++14
189
template <bool b, class T, class F>
190
using conditional_t = typename conditional<b,T,F>::type; // C++14
191
template <class... T>
192
using common_type_t = typename common_type<T...>::type; // C++14
194
using underlying_type_t = typename underlying_type<T>::type; // C++14
195
template <class F, class... ArgTypes>
196
using result_of_t = typename result_of<F(ArgTypes...)>::type; // C++14
153
212
template <class _If, class _Then>
154
213
struct _LIBCPP_TYPE_VIS conditional<false, _If, _Then> {typedef _Then type;};
215
#if _LIBCPP_STD_VER > 11
216
template <bool _Bp, class _If, class _Then> using conditional_t = typename conditional<_Bp, _If, _Then>::type;
156
219
template <bool, class _Tp = void> struct _LIBCPP_TYPE_VIS enable_if {};
157
220
template <class _Tp> struct _LIBCPP_TYPE_VIS enable_if<true, _Tp> {typedef _Tp type;};
222
#if _LIBCPP_STD_VER > 11
223
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
159
227
struct __two {char __lx[2];};
168
236
typedef integral_constant type;
169
237
_LIBCPP_INLINE_VISIBILITY
170
238
_LIBCPP_CONSTEXPR operator value_type() const {return value;}
239
#if _LIBCPP_STD_VER > 11
240
_LIBCPP_INLINE_VISIBILITY
241
constexpr value_type operator ()() const {return value;}
173
245
template <class _Tp, _Tp __v>
191
263
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_const {typedef _Tp type;};
192
264
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_const<const _Tp> {typedef _Tp type;};
265
#if _LIBCPP_STD_VER > 11
266
template <class _Tp> using remove_const_t = typename remove_const<_Tp>::type;
194
269
// remove_volatile
196
271
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile {typedef _Tp type;};
197
272
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_volatile<volatile _Tp> {typedef _Tp type;};
273
#if _LIBCPP_STD_VER > 11
274
template <class _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type;
201
279
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_cv
202
280
{typedef typename remove_volatile<typename remove_const<_Tp>::type>::type type;};
281
#if _LIBCPP_STD_VER > 11
282
template <class _Tp> using remove_cv_t = typename remove_cv<_Tp>::type;
458
543
template <class _Tp> struct _LIBCPP_TYPE_VIS add_volatile
459
544
{typedef typename __add_volatile<_Tp>::type type;};
546
#if _LIBCPP_STD_VER > 11
547
template <class _Tp> using add_volatile_t = typename add_volatile<_Tp>::type;
463
552
template <class _Tp> struct _LIBCPP_TYPE_VIS add_cv
464
553
{typedef typename add_const<typename add_volatile<_Tp>::type>::type type;};
555
#if _LIBCPP_STD_VER > 11
556
template <class _Tp> using add_cv_t = typename add_cv<_Tp>::type;
466
559
// remove_reference
468
561
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_reference {typedef _Tp type;};
480
577
template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<volatile void> {typedef volatile void type;};
481
578
template <> struct _LIBCPP_TYPE_VIS add_lvalue_reference<const volatile void> {typedef const volatile void type;};
580
#if _LIBCPP_STD_VER > 11
581
template <class _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
483
584
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
485
586
template <class _Tp> struct _LIBCPP_TYPE_VIS add_rvalue_reference {typedef _Tp&& type;};
488
589
template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<volatile void> {typedef volatile void type;};
489
590
template <> struct _LIBCPP_TYPE_VIS add_rvalue_reference<const volatile void> {typedef const volatile void type;};
592
#if _LIBCPP_STD_VER > 11
593
template <class _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
491
596
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
493
598
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
517
622
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* volatile> {typedef _Tp type;};
518
623
template <class _Tp> struct _LIBCPP_TYPE_VIS remove_pointer<_Tp* const volatile> {typedef _Tp type;};
625
#if _LIBCPP_STD_VER > 11
626
template <class _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type;
522
631
template <class _Tp> struct _LIBCPP_TYPE_VIS add_pointer
523
632
{typedef typename remove_reference<_Tp>::type* type;};
634
#if _LIBCPP_STD_VER > 11
635
template <class _Tp> using add_pointer_t = typename add_pointer<_Tp>::type;
527
640
template <class _Tp, bool = is_integral<_Tp>::value>
805
template <class _Tp> struct __is_polymorphic1 : public _Tp {};
806
template <class _Tp> struct __is_polymorphic2 : public _Tp {virtual ~__is_polymorphic2() throw();};
808
template <class _Tp, bool = is_class<_Tp>::value>
809
struct __libcpp_polymorphic
810
: public integral_constant<bool, sizeof(__is_polymorphic1<_Tp>) == sizeof(__is_polymorphic2<_Tp>)> {};
812
template <class _Tp> struct __libcpp_polymorphic<_Tp, false> : public false_type {};
926
template<typename _Tp> char &__is_polymorphic_impl(
927
typename enable_if<sizeof((_Tp*)dynamic_cast<const volatile void*>(declval<_Tp*>())) != 0,
929
template<typename _Tp> __two &__is_polymorphic_impl(...);
814
931
template <class _Tp> struct _LIBCPP_TYPE_VIS is_polymorphic
815
: public __libcpp_polymorphic<_Tp> {};
932
: public integral_constant<bool, sizeof(__is_polymorphic_impl<_Tp>(0)) == 1> {};
817
934
#endif // __has_feature(is_polymorphic)
835
template <class _Tp> struct __alignment_of {_Tp __lx;};
837
952
template <class _Tp> struct _LIBCPP_TYPE_VIS alignment_of
838
: public integral_constant<size_t, __alignof__(__alignment_of<typename remove_all_extents<_Tp>::type>)> {};
953
: public integral_constant<size_t, __alignof__(_Tp)> {};
840
955
// aligned_storage
921
1036
struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
922
1037
: public integral_constant<size_t, __select_align<_Len, _Hp::value, __find_max_align<_Tp, _Len>::value>::value> {};
924
template <size_t _Len, const size_t _Align = __find_max_align<__all_types, _Len>::value>
1039
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
925
1040
struct _LIBCPP_TYPE_VIS aligned_storage
927
1042
typedef typename __find_pod<__all_types, _Align>::type _Aligner;
1051
#if _LIBCPP_STD_VER > 11
1052
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
1053
using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
936
1056
#define _CREATE_ALIGNED_STORAGE_SPECIALIZATION(n) \
937
1057
template <size_t _Len>\
938
1058
struct _LIBCPP_TYPE_VIS aligned_storage<_Len, n>\
958
1078
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x1000);
959
1079
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x2000);
960
1080
// MSDN says that MSVC does not support alignment beyond 8192 (=0x2000)
961
#if !defined(_MSC_VER)
1081
#if !defined(_LIBCPP_MSVC)
962
1082
_CREATE_ALIGNED_STORAGE_SPECIALIZATION(0x4000);
1083
#endif // !_LIBCPP_MSVC
965
1085
#undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
1087
#ifndef _LIBCPP_HAS_NO_VARIADICS
1091
template <size_t _I0, size_t ..._In>
1092
struct __static_max;
1094
template <size_t _I0>
1095
struct __static_max<_I0>
1097
static const size_t value = _I0;
1100
template <size_t _I0, size_t _I1, size_t ..._In>
1101
struct __static_max<_I0, _I1, _In...>
1103
static const size_t value = _I0 >= _I1 ? __static_max<_I0, _In...>::value :
1104
__static_max<_I1, _In...>::value;
1107
template <size_t _Len, class _Type0, class ..._Types>
1108
struct aligned_union
1110
static const size_t alignment_value = __static_max<__alignof__(_Type0),
1111
__alignof__(_Types)...>::value;
1112
static const size_t __len = __static_max<_Len, sizeof(_Type0),
1113
sizeof(_Types)...>::value;
1114
typedef typename aligned_storage<__len, alignment_value>::type type;
1117
#if _LIBCPP_STD_VER > 11
1118
template <size_t _Len, class ..._Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type;
1121
#endif // _LIBCPP_HAS_NO_VARIADICS
969
1125
template <class _A1, class _A2 = void, class _A3 = void,
1123
1279
typedef typename __apply_cv<_Tp, typename __make_signed<typename remove_cv<_Tp>::type>::type>::type type;
1282
#if _LIBCPP_STD_VER > 11
1283
template <class _Tp> using make_signed_t = typename make_signed<_Tp>::type;
1126
1286
template <class _Tp, bool = is_integral<_Tp>::value || is_enum<_Tp>::value>
1127
1287
struct __make_unsigned {};
1148
1308
typedef typename __apply_cv<_Tp, typename __make_unsigned<typename remove_cv<_Tp>::type>::type>::type type;
1311
#if _LIBCPP_STD_VER > 11
1312
template <class _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type;
1151
1315
#ifdef _LIBCPP_HAS_NO_VARIADICS
1153
1317
template <class _Tp, class _Up = void, class V = void>
1298
1466
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
1300
1468
template <class _Tp>
1301
inline _LIBCPP_INLINE_VISIBILITY
1469
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
1302
1470
typename remove_reference<_Tp>::type&&
1303
1471
move(_Tp&& __t) _NOEXCEPT
1627
1799
template <class _MP>
1628
1800
struct __member_pointer_traits
1629
: public __member_pointer_traits_imp<_MP,
1801
: public __member_pointer_traits_imp<typename remove_cv<_MP>::type,
1630
1802
is_member_function_pointer<_MP>::value,
1631
1803
is_member_object_pointer<_MP>::value>
2852
3024
// bullets 1 and 2
2854
template <class _Fp, class _A0, class ..._Args>
3026
template <class _Fp, class _A0, class ..._Args,
3027
class = typename enable_if
3029
is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3030
is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3031
typename remove_reference<_A0>::type>::value
2855
3034
_LIBCPP_INLINE_VISIBILITY
2857
3036
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
2858
3037
-> decltype((_VSTD::forward<_A0>(__a0).*__f)(_VSTD::forward<_Args>(__args)...));
2860
template <class _Fp, class _A0, class ..._Args>
3039
template <class _Fp, class _A0, class ..._Args,
3040
class = typename enable_if
3042
is_member_function_pointer<typename remove_reference<_Fp>::type>::value &&
3043
!is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3044
typename remove_reference<_A0>::type>::value
2861
3047
_LIBCPP_INLINE_VISIBILITY
2863
3049
__invoke(_Fp&& __f, _A0&& __a0, _Args&& ...__args)
2866
3052
// bullets 3 and 4
2868
template <class _Fp, class _A0>
3054
template <class _Fp, class _A0,
3055
class = typename enable_if
3057
is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
3058
is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3059
typename remove_reference<_A0>::type>::value
2869
3062
_LIBCPP_INLINE_VISIBILITY
2871
3064
__invoke(_Fp&& __f, _A0&& __a0)
2872
3065
-> decltype(_VSTD::forward<_A0>(__a0).*__f);
2874
template <class _Fp, class _A0>
3067
template <class _Fp, class _A0,
3068
class = typename enable_if
3070
is_member_object_pointer<typename remove_reference<_Fp>::type>::value &&
3071
!is_base_of<typename __member_pointer_traits<typename remove_reference<_Fp>::type>::_ClassType,
3072
typename remove_reference<_A0>::type>::value
2875
3075
_LIBCPP_INLINE_VISIBILITY
2877
3077
__invoke(_Fp&& __f, _A0&& __a0)