1*58b9f456SAndroid Build Coastguard Worker// -*- C++ -*- 2*58b9f456SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 3*58b9f456SAndroid Build Coastguard Worker// 4*58b9f456SAndroid Build Coastguard Worker// The LLVM Compiler Infrastructure 5*58b9f456SAndroid Build Coastguard Worker// 6*58b9f456SAndroid Build Coastguard Worker// This file is dual licensed under the MIT and the University of Illinois Open 7*58b9f456SAndroid Build Coastguard Worker// Source Licenses. See LICENSE.TXT for details. 8*58b9f456SAndroid Build Coastguard Worker// 9*58b9f456SAndroid Build Coastguard Worker//===----------------------------------------------------------------------===// 10*58b9f456SAndroid Build Coastguard Worker 11*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP___TUPLE 12*58b9f456SAndroid Build Coastguard Worker#define _LIBCPP___TUPLE 13*58b9f456SAndroid Build Coastguard Worker 14*58b9f456SAndroid Build Coastguard Worker#include <__config> 15*58b9f456SAndroid Build Coastguard Worker#include <cstddef> 16*58b9f456SAndroid Build Coastguard Worker#include <type_traits> 17*58b9f456SAndroid Build Coastguard Worker 18*58b9f456SAndroid Build Coastguard Worker#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) 19*58b9f456SAndroid Build Coastguard Worker#pragma GCC system_header 20*58b9f456SAndroid Build Coastguard Worker#endif 21*58b9f456SAndroid Build Coastguard Worker 22*58b9f456SAndroid Build Coastguard Worker 23*58b9f456SAndroid Build Coastguard Worker_LIBCPP_BEGIN_NAMESPACE_STD 24*58b9f456SAndroid Build Coastguard Worker 25*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size; 26*58b9f456SAndroid Build Coastguard Worker 27*58b9f456SAndroid Build Coastguard Worker#if !defined(_LIBCPP_CXX03_LANG) 28*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class...> 29*58b9f456SAndroid Build Coastguard Workerusing __enable_if_tuple_size_imp = _Tp; 30*58b9f456SAndroid Build Coastguard Worker 31*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> 32*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< 33*58b9f456SAndroid Build Coastguard Worker const _Tp, 34*58b9f456SAndroid Build Coastguard Worker typename enable_if<!is_volatile<_Tp>::value>::type, 35*58b9f456SAndroid Build Coastguard Worker integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> 36*58b9f456SAndroid Build Coastguard Worker : public integral_constant<size_t, tuple_size<_Tp>::value> {}; 37*58b9f456SAndroid Build Coastguard Worker 38*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> 39*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< 40*58b9f456SAndroid Build Coastguard Worker volatile _Tp, 41*58b9f456SAndroid Build Coastguard Worker typename enable_if<!is_const<_Tp>::value>::type, 42*58b9f456SAndroid Build Coastguard Worker integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> 43*58b9f456SAndroid Build Coastguard Worker : public integral_constant<size_t, tuple_size<_Tp>::value> {}; 44*58b9f456SAndroid Build Coastguard Worker 45*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> 46*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp< 47*58b9f456SAndroid Build Coastguard Worker const volatile _Tp, 48*58b9f456SAndroid Build Coastguard Worker integral_constant<size_t, sizeof(tuple_size<_Tp>)>>> 49*58b9f456SAndroid Build Coastguard Worker : public integral_constant<size_t, tuple_size<_Tp>::value> {}; 50*58b9f456SAndroid Build Coastguard Worker 51*58b9f456SAndroid Build Coastguard Worker#else 52*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {}; 53*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {}; 54*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {}; 55*58b9f456SAndroid Build Coastguard Worker#endif 56*58b9f456SAndroid Build Coastguard Worker 57*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp> class _LIBCPP_TEMPLATE_VIS tuple_element; 58*58b9f456SAndroid Build Coastguard Worker 59*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp> 60*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp> 61*58b9f456SAndroid Build Coastguard Worker{ 62*58b9f456SAndroid Build Coastguard Workerpublic: 63*58b9f456SAndroid Build Coastguard Worker typedef typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type; 64*58b9f456SAndroid Build Coastguard Worker}; 65*58b9f456SAndroid Build Coastguard Worker 66*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp> 67*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp> 68*58b9f456SAndroid Build Coastguard Worker{ 69*58b9f456SAndroid Build Coastguard Workerpublic: 70*58b9f456SAndroid Build Coastguard Worker typedef typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type; 71*58b9f456SAndroid Build Coastguard Worker}; 72*58b9f456SAndroid Build Coastguard Worker 73*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp> 74*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp> 75*58b9f456SAndroid Build Coastguard Worker{ 76*58b9f456SAndroid Build Coastguard Workerpublic: 77*58b9f456SAndroid Build Coastguard Worker typedef typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type; 78*58b9f456SAndroid Build Coastguard Worker}; 79*58b9f456SAndroid Build Coastguard Worker 80*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct __tuple_like : false_type {}; 81*58b9f456SAndroid Build Coastguard Worker 82*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {}; 83*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {}; 84*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {}; 85*58b9f456SAndroid Build Coastguard Worker 86*58b9f456SAndroid Build Coastguard Worker// tuple specializations 87*58b9f456SAndroid Build Coastguard Worker 88*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 89*58b9f456SAndroid Build Coastguard Worker 90*58b9f456SAndroid Build Coastguard Workertemplate <size_t...> struct __tuple_indices {}; 91*58b9f456SAndroid Build Coastguard Worker 92*58b9f456SAndroid Build Coastguard Workertemplate <class _IdxType, _IdxType... _Values> 93*58b9f456SAndroid Build Coastguard Workerstruct __integer_sequence { 94*58b9f456SAndroid Build Coastguard Worker template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType> 95*58b9f456SAndroid Build Coastguard Worker using __convert = _ToIndexSeq<_ToIndexType, _Values...>; 96*58b9f456SAndroid Build Coastguard Worker 97*58b9f456SAndroid Build Coastguard Worker template <size_t _Sp> 98*58b9f456SAndroid Build Coastguard Worker using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>; 99*58b9f456SAndroid Build Coastguard Worker}; 100*58b9f456SAndroid Build Coastguard Worker 101*58b9f456SAndroid Build Coastguard Worker#if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) 102*58b9f456SAndroid Build Coastguard Workernamespace __detail { 103*58b9f456SAndroid Build Coastguard Worker 104*58b9f456SAndroid Build Coastguard Workertemplate<typename _Tp, size_t ..._Extra> struct __repeat; 105*58b9f456SAndroid Build Coastguard Workertemplate<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> { 106*58b9f456SAndroid Build Coastguard Worker typedef __integer_sequence<_Tp, 107*58b9f456SAndroid Build Coastguard Worker _Np..., 108*58b9f456SAndroid Build Coastguard Worker sizeof...(_Np) + _Np..., 109*58b9f456SAndroid Build Coastguard Worker 2 * sizeof...(_Np) + _Np..., 110*58b9f456SAndroid Build Coastguard Worker 3 * sizeof...(_Np) + _Np..., 111*58b9f456SAndroid Build Coastguard Worker 4 * sizeof...(_Np) + _Np..., 112*58b9f456SAndroid Build Coastguard Worker 5 * sizeof...(_Np) + _Np..., 113*58b9f456SAndroid Build Coastguard Worker 6 * sizeof...(_Np) + _Np..., 114*58b9f456SAndroid Build Coastguard Worker 7 * sizeof...(_Np) + _Np..., 115*58b9f456SAndroid Build Coastguard Worker _Extra...> type; 116*58b9f456SAndroid Build Coastguard Worker}; 117*58b9f456SAndroid Build Coastguard Worker 118*58b9f456SAndroid Build Coastguard Workertemplate<size_t _Np> struct __parity; 119*58b9f456SAndroid Build Coastguard Workertemplate<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {}; 120*58b9f456SAndroid Build Coastguard Worker 121*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<0> { typedef __integer_sequence<size_t> type; }; 122*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<1> { typedef __integer_sequence<size_t, 0> type; }; 123*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<2> { typedef __integer_sequence<size_t, 0, 1> type; }; 124*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<3> { typedef __integer_sequence<size_t, 0, 1, 2> type; }; 125*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<4> { typedef __integer_sequence<size_t, 0, 1, 2, 3> type; }; 126*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<5> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4> type; }; 127*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<6> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; }; 128*58b9f456SAndroid Build Coastguard Workertemplate<> struct __make<7> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; }; 129*58b9f456SAndroid Build Coastguard Worker 130*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; }; 131*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; }; 132*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; }; 133*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; }; 134*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; 135*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<5> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; 136*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<6> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; 137*58b9f456SAndroid Build Coastguard Workertemplate<> struct __parity<7> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 7, _Np - 6, _Np - 5, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; }; 138*58b9f456SAndroid Build Coastguard Worker 139*58b9f456SAndroid Build Coastguard Worker} // namespace detail 140*58b9f456SAndroid Build Coastguard Worker 141*58b9f456SAndroid Build Coastguard Worker#endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE) 142*58b9f456SAndroid Build Coastguard Worker 143*58b9f456SAndroid Build Coastguard Worker#if __has_builtin(__make_integer_seq) 144*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ep, size_t _Sp> 145*58b9f456SAndroid Build Coastguard Workerusing __make_indices_imp = 146*58b9f456SAndroid Build Coastguard Worker typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template 147*58b9f456SAndroid Build Coastguard Worker __to_tuple_indices<_Sp>; 148*58b9f456SAndroid Build Coastguard Worker#else 149*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ep, size_t _Sp> 150*58b9f456SAndroid Build Coastguard Workerusing __make_indices_imp = 151*58b9f456SAndroid Build Coastguard Worker typename __detail::__make<_Ep - _Sp>::type::template __to_tuple_indices<_Sp>; 152*58b9f456SAndroid Build Coastguard Worker 153*58b9f456SAndroid Build Coastguard Worker#endif 154*58b9f456SAndroid Build Coastguard Worker 155*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ep, size_t _Sp = 0> 156*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_indices 157*58b9f456SAndroid Build Coastguard Worker{ 158*58b9f456SAndroid Build Coastguard Worker static_assert(_Sp <= _Ep, "__make_tuple_indices input error"); 159*58b9f456SAndroid Build Coastguard Worker typedef __make_indices_imp<_Ep, _Sp> type; 160*58b9f456SAndroid Build Coastguard Worker}; 161*58b9f456SAndroid Build Coastguard Worker 162*58b9f456SAndroid Build Coastguard Worker 163*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple; 164*58b9f456SAndroid Build Coastguard Worker 165*58b9f456SAndroid Build Coastguard Workertemplate <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {}; 166*58b9f456SAndroid Build Coastguard Worker 167*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Tp> 168*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> > 169*58b9f456SAndroid Build Coastguard Worker : public integral_constant<size_t, sizeof...(_Tp)> 170*58b9f456SAndroid Build Coastguard Worker{ 171*58b9f456SAndroid Build Coastguard Worker}; 172*58b9f456SAndroid Build Coastguard Worker 173*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 174*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 175*58b9f456SAndroid Build Coastguard Workertypename tuple_element<_Ip, tuple<_Tp...> >::type& 176*58b9f456SAndroid Build Coastguard Workerget(tuple<_Tp...>&) _NOEXCEPT; 177*58b9f456SAndroid Build Coastguard Worker 178*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 179*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 180*58b9f456SAndroid Build Coastguard Workerconst typename tuple_element<_Ip, tuple<_Tp...> >::type& 181*58b9f456SAndroid Build Coastguard Workerget(const tuple<_Tp...>&) _NOEXCEPT; 182*58b9f456SAndroid Build Coastguard Worker 183*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 184*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 185*58b9f456SAndroid Build Coastguard Workertypename tuple_element<_Ip, tuple<_Tp...> >::type&& 186*58b9f456SAndroid Build Coastguard Workerget(tuple<_Tp...>&&) _NOEXCEPT; 187*58b9f456SAndroid Build Coastguard Worker 188*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 189*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 190*58b9f456SAndroid Build Coastguard Workerconst typename tuple_element<_Ip, tuple<_Tp...> >::type&& 191*58b9f456SAndroid Build Coastguard Workerget(const tuple<_Tp...>&&) _NOEXCEPT; 192*58b9f456SAndroid Build Coastguard Worker 193*58b9f456SAndroid Build Coastguard Worker#endif // !defined(_LIBCPP_CXX03_LANG) 194*58b9f456SAndroid Build Coastguard Worker 195*58b9f456SAndroid Build Coastguard Worker// pair specializations 196*58b9f456SAndroid Build Coastguard Worker 197*58b9f456SAndroid Build Coastguard Workertemplate <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {}; 198*58b9f456SAndroid Build Coastguard Worker 199*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _T1, class _T2> 200*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 201*58b9f456SAndroid Build Coastguard Workertypename tuple_element<_Ip, pair<_T1, _T2> >::type& 202*58b9f456SAndroid Build Coastguard Workerget(pair<_T1, _T2>&) _NOEXCEPT; 203*58b9f456SAndroid Build Coastguard Worker 204*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _T1, class _T2> 205*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 206*58b9f456SAndroid Build Coastguard Workerconst typename tuple_element<_Ip, pair<_T1, _T2> >::type& 207*58b9f456SAndroid Build Coastguard Workerget(const pair<_T1, _T2>&) _NOEXCEPT; 208*58b9f456SAndroid Build Coastguard Worker 209*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 210*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _T1, class _T2> 211*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 212*58b9f456SAndroid Build Coastguard Workertypename tuple_element<_Ip, pair<_T1, _T2> >::type&& 213*58b9f456SAndroid Build Coastguard Workerget(pair<_T1, _T2>&&) _NOEXCEPT; 214*58b9f456SAndroid Build Coastguard Worker 215*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _T1, class _T2> 216*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 217*58b9f456SAndroid Build Coastguard Workerconst typename tuple_element<_Ip, pair<_T1, _T2> >::type&& 218*58b9f456SAndroid Build Coastguard Workerget(const pair<_T1, _T2>&&) _NOEXCEPT; 219*58b9f456SAndroid Build Coastguard Worker#endif 220*58b9f456SAndroid Build Coastguard Worker 221*58b9f456SAndroid Build Coastguard Worker// array specializations 222*58b9f456SAndroid Build Coastguard Worker 223*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array; 224*58b9f456SAndroid Build Coastguard Worker 225*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {}; 226*58b9f456SAndroid Build Coastguard Worker 227*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp, size_t _Size> 228*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 229*58b9f456SAndroid Build Coastguard Worker_Tp& 230*58b9f456SAndroid Build Coastguard Workerget(array<_Tp, _Size>&) _NOEXCEPT; 231*58b9f456SAndroid Build Coastguard Worker 232*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp, size_t _Size> 233*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 234*58b9f456SAndroid Build Coastguard Workerconst _Tp& 235*58b9f456SAndroid Build Coastguard Workerget(const array<_Tp, _Size>&) _NOEXCEPT; 236*58b9f456SAndroid Build Coastguard Worker 237*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 238*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp, size_t _Size> 239*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 240*58b9f456SAndroid Build Coastguard Worker_Tp&& 241*58b9f456SAndroid Build Coastguard Workerget(array<_Tp, _Size>&&) _NOEXCEPT; 242*58b9f456SAndroid Build Coastguard Worker 243*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class _Tp, size_t _Size> 244*58b9f456SAndroid Build Coastguard Worker_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 245*58b9f456SAndroid Build Coastguard Workerconst _Tp&& 246*58b9f456SAndroid Build Coastguard Workerget(const array<_Tp, _Size>&&) _NOEXCEPT; 247*58b9f456SAndroid Build Coastguard Worker#endif 248*58b9f456SAndroid Build Coastguard Worker 249*58b9f456SAndroid Build Coastguard Worker#ifndef _LIBCPP_CXX03_LANG 250*58b9f456SAndroid Build Coastguard Worker 251*58b9f456SAndroid Build Coastguard Worker// __tuple_types 252*58b9f456SAndroid Build Coastguard Worker 253*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Tp> struct __tuple_types {}; 254*58b9f456SAndroid Build Coastguard Worker 255*58b9f456SAndroid Build Coastguard Worker#if !__has_builtin(__type_pack_element) 256*58b9f456SAndroid Build Coastguard Worker 257*58b9f456SAndroid Build Coastguard Workernamespace __indexer_detail { 258*58b9f456SAndroid Build Coastguard Worker 259*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Idx, class _Tp> 260*58b9f456SAndroid Build Coastguard Workerstruct __indexed { using type = _Tp; }; 261*58b9f456SAndroid Build Coastguard Worker 262*58b9f456SAndroid Build Coastguard Workertemplate <class _Types, class _Indexes> struct __indexer; 263*58b9f456SAndroid Build Coastguard Worker 264*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Types, size_t ..._Idx> 265*58b9f456SAndroid Build Coastguard Workerstruct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>> 266*58b9f456SAndroid Build Coastguard Worker : __indexed<_Idx, _Types>... 267*58b9f456SAndroid Build Coastguard Worker{}; 268*58b9f456SAndroid Build Coastguard Worker 269*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Idx, class _Tp> 270*58b9f456SAndroid Build Coastguard Worker__indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&); 271*58b9f456SAndroid Build Coastguard Worker 272*58b9f456SAndroid Build Coastguard Worker} // namespace __indexer_detail 273*58b9f456SAndroid Build Coastguard Worker 274*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Idx, class ..._Types> 275*58b9f456SAndroid Build Coastguard Workerusing __type_pack_element = typename decltype( 276*58b9f456SAndroid Build Coastguard Worker __indexer_detail::__at_index<_Idx>( 277*58b9f456SAndroid Build Coastguard Worker __indexer_detail::__indexer< 278*58b9f456SAndroid Build Coastguard Worker __tuple_types<_Types...>, 279*58b9f456SAndroid Build Coastguard Worker typename __make_tuple_indices<sizeof...(_Types)>::type 280*58b9f456SAndroid Build Coastguard Worker >{}) 281*58b9f456SAndroid Build Coastguard Worker )::type; 282*58b9f456SAndroid Build Coastguard Worker#endif 283*58b9f456SAndroid Build Coastguard Worker 284*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Types> 285*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>> 286*58b9f456SAndroid Build Coastguard Worker{ 287*58b9f456SAndroid Build Coastguard Workerpublic: 288*58b9f456SAndroid Build Coastguard Worker static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range"); 289*58b9f456SAndroid Build Coastguard Worker typedef __type_pack_element<_Ip, _Types...> type; 290*58b9f456SAndroid Build Coastguard Worker}; 291*58b9f456SAndroid Build Coastguard Worker 292*58b9f456SAndroid Build Coastguard Worker 293*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Tp> 294*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> > 295*58b9f456SAndroid Build Coastguard Worker : public integral_constant<size_t, sizeof...(_Tp)> 296*58b9f456SAndroid Build Coastguard Worker{ 297*58b9f456SAndroid Build Coastguard Worker}; 298*58b9f456SAndroid Build Coastguard Worker 299*58b9f456SAndroid Build Coastguard Workertemplate <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {}; 300*58b9f456SAndroid Build Coastguard Worker 301*58b9f456SAndroid Build Coastguard Workertemplate <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile> 302*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf; 303*58b9f456SAndroid Build Coastguard Workertemplate <> 304*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<false, false, false> { 305*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = _Tp; 306*58b9f456SAndroid Build Coastguard Worker}; 307*58b9f456SAndroid Build Coastguard Workertemplate <> 308*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<false, true, false> { 309*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = const _Tp; 310*58b9f456SAndroid Build Coastguard Worker}; 311*58b9f456SAndroid Build Coastguard Workertemplate <> 312*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<false, false, true> { 313*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = volatile _Tp; 314*58b9f456SAndroid Build Coastguard Worker}; 315*58b9f456SAndroid Build Coastguard Workertemplate <> 316*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<false, true, true> { 317*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = const volatile _Tp; 318*58b9f456SAndroid Build Coastguard Worker}; 319*58b9f456SAndroid Build Coastguard Workertemplate <> 320*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<true, false, false> { 321*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = _Tp&; 322*58b9f456SAndroid Build Coastguard Worker}; 323*58b9f456SAndroid Build Coastguard Workertemplate <> 324*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<true, true, false> { 325*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = const _Tp&; 326*58b9f456SAndroid Build Coastguard Worker}; 327*58b9f456SAndroid Build Coastguard Workertemplate <> 328*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<true, false, true> { 329*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = volatile _Tp&; 330*58b9f456SAndroid Build Coastguard Worker}; 331*58b9f456SAndroid Build Coastguard Workertemplate <> 332*58b9f456SAndroid Build Coastguard Workerstruct __apply_cv_mf<true, true, true> { 333*58b9f456SAndroid Build Coastguard Worker template <class _Tp> using __apply = const volatile _Tp&; 334*58b9f456SAndroid Build Coastguard Worker}; 335*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _RawTp = typename remove_reference<_Tp>::type> 336*58b9f456SAndroid Build Coastguard Workerusing __apply_cv_t = __apply_cv_mf< 337*58b9f456SAndroid Build Coastguard Worker is_lvalue_reference<_Tp>::value, 338*58b9f456SAndroid Build Coastguard Worker is_const<_RawTp>::value, 339*58b9f456SAndroid Build Coastguard Worker is_volatile<_RawTp>::value>; 340*58b9f456SAndroid Build Coastguard Worker 341*58b9f456SAndroid Build Coastguard Worker// __make_tuple_types 342*58b9f456SAndroid Build Coastguard Worker 343*58b9f456SAndroid Build Coastguard Worker// __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a 344*58b9f456SAndroid Build Coastguard Worker// __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep). 345*58b9f456SAndroid Build Coastguard Worker// _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a 346*58b9f456SAndroid Build Coastguard Worker// lvalue_reference type, then __tuple_types<_Types&...> is the result. 347*58b9f456SAndroid Build Coastguard Worker 348*58b9f456SAndroid Build Coastguard Workertemplate <class _TupleTypes, class _TupleIndices> 349*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types_flat; 350*58b9f456SAndroid Build Coastguard Worker 351*58b9f456SAndroid Build Coastguard Workertemplate <template <class...> class _Tuple, class ..._Types, size_t ..._Idx> 352*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> { 353*58b9f456SAndroid Build Coastguard Worker // Specialization for pair, tuple, and __tuple_types 354*58b9f456SAndroid Build Coastguard Worker template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> 355*58b9f456SAndroid Build Coastguard Worker using __apply_quals = __tuple_types< 356*58b9f456SAndroid Build Coastguard Worker typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>... 357*58b9f456SAndroid Build Coastguard Worker >; 358*58b9f456SAndroid Build Coastguard Worker}; 359*58b9f456SAndroid Build Coastguard Worker 360*58b9f456SAndroid Build Coastguard Workertemplate <class _Vt, size_t _Np, size_t ..._Idx> 361*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> { 362*58b9f456SAndroid Build Coastguard Worker template <size_t> 363*58b9f456SAndroid Build Coastguard Worker using __value_type = _Vt; 364*58b9f456SAndroid Build Coastguard Worker template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>> 365*58b9f456SAndroid Build Coastguard Worker using __apply_quals = __tuple_types< 366*58b9f456SAndroid Build Coastguard Worker typename _ApplyFn::template __apply<__value_type<_Idx>>... 367*58b9f456SAndroid Build Coastguard Worker >; 368*58b9f456SAndroid Build Coastguard Worker}; 369*58b9f456SAndroid Build Coastguard Worker 370*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value, 371*58b9f456SAndroid Build Coastguard Worker size_t _Sp = 0, 372*58b9f456SAndroid Build Coastguard Worker bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)> 373*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types 374*58b9f456SAndroid Build Coastguard Worker{ 375*58b9f456SAndroid Build Coastguard Worker static_assert(_Sp <= _Ep, "__make_tuple_types input error"); 376*58b9f456SAndroid Build Coastguard Worker using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type; 377*58b9f456SAndroid Build Coastguard Worker using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>; 378*58b9f456SAndroid Build Coastguard Worker using type = typename _Maker::template __apply_quals<_Tp>; 379*58b9f456SAndroid Build Coastguard Worker}; 380*58b9f456SAndroid Build Coastguard Worker 381*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Types, size_t _Ep> 382*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> { 383*58b9f456SAndroid Build Coastguard Worker typedef __tuple_types<_Types...> type; 384*58b9f456SAndroid Build Coastguard Worker}; 385*58b9f456SAndroid Build Coastguard Worker 386*58b9f456SAndroid Build Coastguard Workertemplate <class ..._Types, size_t _Ep> 387*58b9f456SAndroid Build Coastguard Workerstruct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> { 388*58b9f456SAndroid Build Coastguard Worker typedef __tuple_types<_Types...> type; 389*58b9f456SAndroid Build Coastguard Worker}; 390*58b9f456SAndroid Build Coastguard Worker 391*58b9f456SAndroid Build Coastguard Workertemplate <bool ..._Preds> 392*58b9f456SAndroid Build Coastguard Workerstruct __all_dummy; 393*58b9f456SAndroid Build Coastguard Worker 394*58b9f456SAndroid Build Coastguard Workertemplate <bool ..._Pred> 395*58b9f456SAndroid Build Coastguard Workerusing __all = is_same<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>>; 396*58b9f456SAndroid Build Coastguard Worker 397*58b9f456SAndroid Build Coastguard Workerstruct __tuple_sfinae_base { 398*58b9f456SAndroid Build Coastguard Worker template <template <class, class...> class _Trait, 399*58b9f456SAndroid Build Coastguard Worker class ..._LArgs, class ..._RArgs> 400*58b9f456SAndroid Build Coastguard Worker static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>) 401*58b9f456SAndroid Build Coastguard Worker -> __all<typename enable_if<_Trait<_LArgs, _RArgs>::value, bool>::type{true}...>; 402*58b9f456SAndroid Build Coastguard Worker template <template <class...> class> 403*58b9f456SAndroid Build Coastguard Worker static auto __do_test(...) -> false_type; 404*58b9f456SAndroid Build Coastguard Worker 405*58b9f456SAndroid Build Coastguard Worker template <class _FromArgs, class _ToArgs> 406*58b9f456SAndroid Build Coastguard Worker using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{})); 407*58b9f456SAndroid Build Coastguard Worker template <class _FromArgs, class _ToArgs> 408*58b9f456SAndroid Build Coastguard Worker using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{})); 409*58b9f456SAndroid Build Coastguard Worker template <class _FromArgs, class _ToArgs> 410*58b9f456SAndroid Build Coastguard Worker using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{})); 411*58b9f456SAndroid Build Coastguard Worker}; 412*58b9f456SAndroid Build Coastguard Worker 413*58b9f456SAndroid Build Coastguard Worker// __tuple_convertible 414*58b9f456SAndroid Build Coastguard Worker 415*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, 416*58b9f456SAndroid Build Coastguard Worker bool = __tuple_like<_Up>::value> 417*58b9f456SAndroid Build Coastguard Workerstruct __tuple_convertible 418*58b9f456SAndroid Build Coastguard Worker : public false_type {}; 419*58b9f456SAndroid Build Coastguard Worker 420*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up> 421*58b9f456SAndroid Build Coastguard Workerstruct __tuple_convertible<_Tp, _Up, true, true> 422*58b9f456SAndroid Build Coastguard Worker : public __tuple_sfinae_base::__convertible< 423*58b9f456SAndroid Build Coastguard Worker typename __make_tuple_types<_Tp>::type 424*58b9f456SAndroid Build Coastguard Worker , typename __make_tuple_types<_Up>::type 425*58b9f456SAndroid Build Coastguard Worker > 426*58b9f456SAndroid Build Coastguard Worker{}; 427*58b9f456SAndroid Build Coastguard Worker 428*58b9f456SAndroid Build Coastguard Worker// __tuple_constructible 429*58b9f456SAndroid Build Coastguard Worker 430*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, 431*58b9f456SAndroid Build Coastguard Worker bool = __tuple_like<_Up>::value> 432*58b9f456SAndroid Build Coastguard Workerstruct __tuple_constructible 433*58b9f456SAndroid Build Coastguard Worker : public false_type {}; 434*58b9f456SAndroid Build Coastguard Worker 435*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up> 436*58b9f456SAndroid Build Coastguard Workerstruct __tuple_constructible<_Tp, _Up, true, true> 437*58b9f456SAndroid Build Coastguard Worker : public __tuple_sfinae_base::__constructible< 438*58b9f456SAndroid Build Coastguard Worker typename __make_tuple_types<_Tp>::type 439*58b9f456SAndroid Build Coastguard Worker , typename __make_tuple_types<_Up>::type 440*58b9f456SAndroid Build Coastguard Worker > 441*58b9f456SAndroid Build Coastguard Worker{}; 442*58b9f456SAndroid Build Coastguard Worker 443*58b9f456SAndroid Build Coastguard Worker// __tuple_assignable 444*58b9f456SAndroid Build Coastguard Worker 445*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value, 446*58b9f456SAndroid Build Coastguard Worker bool = __tuple_like<_Up>::value> 447*58b9f456SAndroid Build Coastguard Workerstruct __tuple_assignable 448*58b9f456SAndroid Build Coastguard Worker : public false_type {}; 449*58b9f456SAndroid Build Coastguard Worker 450*58b9f456SAndroid Build Coastguard Workertemplate <class _Tp, class _Up> 451*58b9f456SAndroid Build Coastguard Workerstruct __tuple_assignable<_Tp, _Up, true, true> 452*58b9f456SAndroid Build Coastguard Worker : public __tuple_sfinae_base::__assignable< 453*58b9f456SAndroid Build Coastguard Worker typename __make_tuple_types<_Tp>::type 454*58b9f456SAndroid Build Coastguard Worker , typename __make_tuple_types<_Up&>::type 455*58b9f456SAndroid Build Coastguard Worker > 456*58b9f456SAndroid Build Coastguard Worker{}; 457*58b9f456SAndroid Build Coastguard Worker 458*58b9f456SAndroid Build Coastguard Worker 459*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 460*58b9f456SAndroid Build Coastguard Workerclass _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> > 461*58b9f456SAndroid Build Coastguard Worker{ 462*58b9f456SAndroid Build Coastguard Workerpublic: 463*58b9f456SAndroid Build Coastguard Worker typedef typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type; 464*58b9f456SAndroid Build Coastguard Worker}; 465*58b9f456SAndroid Build Coastguard Worker 466*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 11 467*58b9f456SAndroid Build Coastguard Workertemplate <size_t _Ip, class ..._Tp> 468*58b9f456SAndroid Build Coastguard Workerusing tuple_element_t = typename tuple_element <_Ip, _Tp...>::type; 469*58b9f456SAndroid Build Coastguard Worker#endif 470*58b9f456SAndroid Build Coastguard Worker 471*58b9f456SAndroid Build Coastguard Workertemplate <bool _IsTuple, class _SizeTrait, size_t _Expected> 472*58b9f456SAndroid Build Coastguard Workerstruct __tuple_like_with_size_imp : false_type {}; 473*58b9f456SAndroid Build Coastguard Worker 474*58b9f456SAndroid Build Coastguard Workertemplate <class _SizeTrait, size_t _Expected> 475*58b9f456SAndroid Build Coastguard Workerstruct __tuple_like_with_size_imp<true, _SizeTrait, _Expected> 476*58b9f456SAndroid Build Coastguard Worker : integral_constant<bool, _SizeTrait::value == _Expected> {}; 477*58b9f456SAndroid Build Coastguard Worker 478*58b9f456SAndroid Build Coastguard Workertemplate <class _Tuple, size_t _ExpectedSize, 479*58b9f456SAndroid Build Coastguard Worker class _RawTuple = typename __uncvref<_Tuple>::type> 480*58b9f456SAndroid Build Coastguard Workerusing __tuple_like_with_size = __tuple_like_with_size_imp< 481*58b9f456SAndroid Build Coastguard Worker __tuple_like<_RawTuple>::value, 482*58b9f456SAndroid Build Coastguard Worker tuple_size<_RawTuple>, _ExpectedSize 483*58b9f456SAndroid Build Coastguard Worker >; 484*58b9f456SAndroid Build Coastguard Worker 485*58b9f456SAndroid Build Coastguard Workerstruct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail { 486*58b9f456SAndroid Build Coastguard Worker template <class ...> 487*58b9f456SAndroid Build Coastguard Worker static constexpr bool __enable_default() { return false; } 488*58b9f456SAndroid Build Coastguard Worker template <class ...> 489*58b9f456SAndroid Build Coastguard Worker static constexpr bool __enable_explicit() { return false; } 490*58b9f456SAndroid Build Coastguard Worker template <class ...> 491*58b9f456SAndroid Build Coastguard Worker static constexpr bool __enable_implicit() { return false; } 492*58b9f456SAndroid Build Coastguard Worker template <class ...> 493*58b9f456SAndroid Build Coastguard Worker static constexpr bool __enable_assign() { return false; } 494*58b9f456SAndroid Build Coastguard Worker}; 495*58b9f456SAndroid Build Coastguard Worker#endif // !defined(_LIBCPP_CXX03_LANG) 496*58b9f456SAndroid Build Coastguard Worker 497*58b9f456SAndroid Build Coastguard Worker#if _LIBCPP_STD_VER > 14 498*58b9f456SAndroid Build Coastguard Worker 499*58b9f456SAndroid Build Coastguard Workertemplate <bool _CanCopy, bool _CanMove> 500*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_ctor_base {}; 501*58b9f456SAndroid Build Coastguard Workertemplate <> 502*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_ctor_base<false, false> { 503*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base() = default; 504*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base const&) = delete; 505*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base &&) = delete; 506*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; 507*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; 508*58b9f456SAndroid Build Coastguard Worker}; 509*58b9f456SAndroid Build Coastguard Workertemplate <> 510*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_ctor_base<true, false> { 511*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base() = default; 512*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base const&) = default; 513*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base &&) = delete; 514*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; 515*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; 516*58b9f456SAndroid Build Coastguard Worker}; 517*58b9f456SAndroid Build Coastguard Workertemplate <> 518*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_ctor_base<false, true> { 519*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base() = default; 520*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base const&) = delete; 521*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base(__sfinae_ctor_base &&) = default; 522*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default; 523*58b9f456SAndroid Build Coastguard Worker __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default; 524*58b9f456SAndroid Build Coastguard Worker}; 525*58b9f456SAndroid Build Coastguard Worker 526*58b9f456SAndroid Build Coastguard Workertemplate <bool _CanCopy, bool _CanMove> 527*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_assign_base {}; 528*58b9f456SAndroid Build Coastguard Workertemplate <> 529*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_assign_base<false, false> { 530*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base() = default; 531*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base const&) = default; 532*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base &&) = default; 533*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete; 534*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete; 535*58b9f456SAndroid Build Coastguard Worker}; 536*58b9f456SAndroid Build Coastguard Workertemplate <> 537*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_assign_base<true, false> { 538*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base() = default; 539*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base const&) = default; 540*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base &&) = default; 541*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default; 542*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete; 543*58b9f456SAndroid Build Coastguard Worker}; 544*58b9f456SAndroid Build Coastguard Workertemplate <> 545*58b9f456SAndroid Build Coastguard Workerstruct __sfinae_assign_base<false, true> { 546*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base() = default; 547*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base const&) = default; 548*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base(__sfinae_assign_base &&) = default; 549*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete; 550*58b9f456SAndroid Build Coastguard Worker __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default; 551*58b9f456SAndroid Build Coastguard Worker}; 552*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP_STD_VER > 14 553*58b9f456SAndroid Build Coastguard Worker 554*58b9f456SAndroid Build Coastguard Worker_LIBCPP_END_NAMESPACE_STD 555*58b9f456SAndroid Build Coastguard Worker 556*58b9f456SAndroid Build Coastguard Worker#endif // _LIBCPP___TUPLE 557