2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___TUPLE
11 #define _LIBCPP___TUPLE
15 #include <type_traits>
17 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
18 #pragma GCC system_header
22 _LIBCPP_BEGIN_NAMESPACE_STD
24 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size;
26 #if !defined(_LIBCPP_CXX03_LANG)
27 template <class _Tp, class...>
28 using __enable_if_tuple_size_imp = _Tp;
31 struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
33 typename enable_if<!is_volatile<_Tp>::value>::type,
34 integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
35 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
38 struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
40 typename enable_if<!is_const<_Tp>::value>::type,
41 integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
42 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
45 struct _LIBCPP_TEMPLATE_VIS tuple_size<__enable_if_tuple_size_imp<
47 integral_constant<size_t, sizeof(tuple_size<_Tp>)>>>
48 : public integral_constant<size_t, tuple_size<_Tp>::value> {};
51 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const _Tp> : public tuple_size<_Tp> {};
52 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<volatile _Tp> : public tuple_size<_Tp> {};
53 template <class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_size<const volatile _Tp> : public tuple_size<_Tp> {};
56 template <size_t _Ip, class _Tp> struct _LIBCPP_TEMPLATE_VIS tuple_element;
58 template <size_t _Ip, class _Tp>
59 struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const _Tp>
61 typedef _LIBCPP_NODEBUG typename add_const<typename tuple_element<_Ip, _Tp>::type>::type type;
64 template <size_t _Ip, class _Tp>
65 struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, volatile _Tp>
67 typedef _LIBCPP_NODEBUG typename add_volatile<typename tuple_element<_Ip, _Tp>::type>::type type;
70 template <size_t _Ip, class _Tp>
71 struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, const volatile _Tp>
73 typedef _LIBCPP_NODEBUG typename add_cv<typename tuple_element<_Ip, _Tp>::type>::type type;
76 template <class _Tp> struct __tuple_like : false_type {};
78 template <class _Tp> struct __tuple_like<const _Tp> : public __tuple_like<_Tp> {};
79 template <class _Tp> struct __tuple_like<volatile _Tp> : public __tuple_like<_Tp> {};
80 template <class _Tp> struct __tuple_like<const volatile _Tp> : public __tuple_like<_Tp> {};
82 // tuple specializations
84 #ifndef _LIBCPP_CXX03_LANG
86 template <size_t...> struct __tuple_indices {};
88 template <class _IdxType, _IdxType... _Values>
89 struct __integer_sequence {
90 template <template <class _OIdxType, _OIdxType...> class _ToIndexSeq, class _ToIndexType>
91 using __convert = _ToIndexSeq<_ToIndexType, _Values...>;
94 using __to_tuple_indices = __tuple_indices<(_Values + _Sp)...>;
97 #if !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
100 template<typename _Tp, size_t ..._Extra> struct __repeat;
101 template<typename _Tp, _Tp ..._Np, size_t ..._Extra> struct __repeat<__integer_sequence<_Tp, _Np...>, _Extra...> {
102 typedef _LIBCPP_NODEBUG __integer_sequence<_Tp,
104 sizeof...(_Np) + _Np...,
105 2 * sizeof...(_Np) + _Np...,
106 3 * sizeof...(_Np) + _Np...,
107 4 * sizeof...(_Np) + _Np...,
108 5 * sizeof...(_Np) + _Np...,
109 6 * sizeof...(_Np) + _Np...,
110 7 * sizeof...(_Np) + _Np...,
114 template<size_t _Np> struct __parity;
115 template<size_t _Np> struct __make : __parity<_Np % 8>::template __pmake<_Np> {};
117 template<> struct __make<0> { typedef __integer_sequence<size_t> type; };
118 template<> struct __make<1> { typedef __integer_sequence<size_t, 0> type; };
119 template<> struct __make<2> { typedef __integer_sequence<size_t, 0, 1> type; };
120 template<> struct __make<3> { typedef __integer_sequence<size_t, 0, 1, 2> type; };
121 template<> struct __make<4> { typedef __integer_sequence<size_t, 0, 1, 2, 3> type; };
122 template<> struct __make<5> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4> type; };
123 template<> struct __make<6> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5> type; };
124 template<> struct __make<7> { typedef __integer_sequence<size_t, 0, 1, 2, 3, 4, 5, 6> type; };
126 template<> struct __parity<0> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type> {}; };
127 template<> struct __parity<1> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 1> {}; };
128 template<> struct __parity<2> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 2, _Np - 1> {}; };
129 template<> struct __parity<3> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 3, _Np - 2, _Np - 1> {}; };
130 template<> struct __parity<4> { template<size_t _Np> struct __pmake : __repeat<typename __make<_Np / 8>::type, _Np - 4, _Np - 3, _Np - 2, _Np - 1> {}; };
131 template<> 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> {}; };
132 template<> 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> {}; };
133 template<> 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> {}; };
135 } // namespace detail
137 #endif // !__has_builtin(__make_integer_seq) || defined(_LIBCPP_TESTING_FALLBACK_MAKE_INTEGER_SEQUENCE)
139 #if __has_builtin(__make_integer_seq)
140 template <size_t _Ep, size_t _Sp>
141 using __make_indices_imp =
142 typename __make_integer_seq<__integer_sequence, size_t, _Ep - _Sp>::template
143 __to_tuple_indices<_Sp>;
145 template <size_t _Ep, size_t _Sp>
146 using __make_indices_imp =
147 typename __detail::__make<_Ep - _Sp>::type::template __to_tuple_indices<_Sp>;
151 template <size_t _Ep, size_t _Sp = 0>
152 struct __make_tuple_indices
154 static_assert(_Sp <= _Ep, "__make_tuple_indices input error");
155 typedef __make_indices_imp<_Ep, _Sp> type;
159 template <class ..._Tp> class _LIBCPP_TEMPLATE_VIS tuple;
161 template <class... _Tp> struct __tuple_like<tuple<_Tp...> > : true_type {};
163 template <class ..._Tp>
164 struct _LIBCPP_TEMPLATE_VIS tuple_size<tuple<_Tp...> >
165 : public integral_constant<size_t, sizeof...(_Tp)>
169 template <size_t _Ip, class ..._Tp>
170 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
171 typename tuple_element<_Ip, tuple<_Tp...> >::type&
172 get(tuple<_Tp...>&) _NOEXCEPT;
174 template <size_t _Ip, class ..._Tp>
175 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
176 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
177 get(const tuple<_Tp...>&) _NOEXCEPT;
179 template <size_t _Ip, class ..._Tp>
180 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
181 typename tuple_element<_Ip, tuple<_Tp...> >::type&&
182 get(tuple<_Tp...>&&) _NOEXCEPT;
184 template <size_t _Ip, class ..._Tp>
185 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
186 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
187 get(const tuple<_Tp...>&&) _NOEXCEPT;
189 #endif // !defined(_LIBCPP_CXX03_LANG)
191 // pair specializations
193 template <class _T1, class _T2> struct __tuple_like<pair<_T1, _T2> > : true_type {};
195 template <size_t _Ip, class _T1, class _T2>
196 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
197 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
198 get(pair<_T1, _T2>&) _NOEXCEPT;
200 template <size_t _Ip, class _T1, class _T2>
201 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
202 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
203 get(const pair<_T1, _T2>&) _NOEXCEPT;
205 #ifndef _LIBCPP_CXX03_LANG
206 template <size_t _Ip, class _T1, class _T2>
207 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
208 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
209 get(pair<_T1, _T2>&&) _NOEXCEPT;
211 template <size_t _Ip, class _T1, class _T2>
212 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
213 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
214 get(const pair<_T1, _T2>&&) _NOEXCEPT;
217 // array specializations
219 template <class _Tp, size_t _Size> struct _LIBCPP_TEMPLATE_VIS array;
221 template <class _Tp, size_t _Size> struct __tuple_like<array<_Tp, _Size> > : true_type {};
223 template <size_t _Ip, class _Tp, size_t _Size>
224 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
226 get(array<_Tp, _Size>&) _NOEXCEPT;
228 template <size_t _Ip, class _Tp, size_t _Size>
229 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
231 get(const array<_Tp, _Size>&) _NOEXCEPT;
233 #ifndef _LIBCPP_CXX03_LANG
234 template <size_t _Ip, class _Tp, size_t _Size>
235 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
237 get(array<_Tp, _Size>&&) _NOEXCEPT;
239 template <size_t _Ip, class _Tp, size_t _Size>
240 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
242 get(const array<_Tp, _Size>&&) _NOEXCEPT;
245 #ifndef _LIBCPP_CXX03_LANG
249 template <class ..._Tp> struct __tuple_types {};
251 #if !__has_builtin(__type_pack_element)
253 namespace __indexer_detail {
255 template <size_t _Idx, class _Tp>
256 struct __indexed { using type _LIBCPP_NODEBUG = _Tp; };
258 template <class _Types, class _Indexes> struct __indexer;
260 template <class ..._Types, size_t ..._Idx>
261 struct __indexer<__tuple_types<_Types...>, __tuple_indices<_Idx...>>
262 : __indexed<_Idx, _Types>...
265 template <size_t _Idx, class _Tp>
266 __indexed<_Idx, _Tp> __at_index(__indexed<_Idx, _Tp> const&);
268 } // namespace __indexer_detail
270 template <size_t _Idx, class ..._Types>
271 using __type_pack_element _LIBCPP_NODEBUG = typename decltype(
272 __indexer_detail::__at_index<_Idx>(
273 __indexer_detail::__indexer<
274 __tuple_types<_Types...>,
275 typename __make_tuple_indices<sizeof...(_Types)>::type
280 template <size_t _Ip, class ..._Types>
281 struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, __tuple_types<_Types...>>
283 static_assert(_Ip < sizeof...(_Types), "tuple_element index out of range");
284 typedef _LIBCPP_NODEBUG __type_pack_element<_Ip, _Types...> type;
288 template <class ..._Tp>
289 struct _LIBCPP_TEMPLATE_VIS tuple_size<__tuple_types<_Tp...> >
290 : public integral_constant<size_t, sizeof...(_Tp)>
294 template <class... _Tp> struct __tuple_like<__tuple_types<_Tp...> > : true_type {};
296 template <bool _ApplyLV, bool _ApplyConst, bool _ApplyVolatile>
297 struct __apply_cv_mf;
299 struct __apply_cv_mf<false, false, false> {
300 template <class _Tp> using __apply = _Tp;
303 struct __apply_cv_mf<false, true, false> {
304 template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp;
307 struct __apply_cv_mf<false, false, true> {
308 template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp;
311 struct __apply_cv_mf<false, true, true> {
312 template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp;
315 struct __apply_cv_mf<true, false, false> {
316 template <class _Tp> using __apply _LIBCPP_NODEBUG = _Tp&;
319 struct __apply_cv_mf<true, true, false> {
320 template <class _Tp> using __apply _LIBCPP_NODEBUG = const _Tp&;
323 struct __apply_cv_mf<true, false, true> {
324 template <class _Tp> using __apply _LIBCPP_NODEBUG = volatile _Tp&;
327 struct __apply_cv_mf<true, true, true> {
328 template <class _Tp> using __apply _LIBCPP_NODEBUG = const volatile _Tp&;
330 template <class _Tp, class _RawTp = typename remove_reference<_Tp>::type>
331 using __apply_cv_t _LIBCPP_NODEBUG = __apply_cv_mf<
332 is_lvalue_reference<_Tp>::value,
333 is_const<_RawTp>::value,
334 is_volatile<_RawTp>::value>;
336 // __make_tuple_types
338 // __make_tuple_types<_Tuple<_Types...>, _Ep, _Sp>::type is a
339 // __tuple_types<_Types...> using only those _Types in the range [_Sp, _Ep).
340 // _Sp defaults to 0 and _Ep defaults to tuple_size<_Tuple>. If _Tuple is a
341 // lvalue_reference type, then __tuple_types<_Types&...> is the result.
343 template <class _TupleTypes, class _TupleIndices>
344 struct __make_tuple_types_flat;
346 template <template <class...> class _Tuple, class ..._Types, size_t ..._Idx>
347 struct __make_tuple_types_flat<_Tuple<_Types...>, __tuple_indices<_Idx...>> {
348 // Specialization for pair, tuple, and __tuple_types
349 template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
350 using __apply_quals _LIBCPP_NODEBUG = __tuple_types<
351 typename _ApplyFn::template __apply<__type_pack_element<_Idx, _Types...>>...
355 template <class _Vt, size_t _Np, size_t ..._Idx>
356 struct __make_tuple_types_flat<array<_Vt, _Np>, __tuple_indices<_Idx...>> {
358 using __value_type = _Vt;
359 template <class _Tp, class _ApplyFn = __apply_cv_t<_Tp>>
360 using __apply_quals = __tuple_types<
361 typename _ApplyFn::template __apply<__value_type<_Idx>>...
365 template <class _Tp, size_t _Ep = tuple_size<typename remove_reference<_Tp>::type>::value,
367 bool _SameSize = (_Ep == tuple_size<typename remove_reference<_Tp>::type>::value)>
368 struct __make_tuple_types
370 static_assert(_Sp <= _Ep, "__make_tuple_types input error");
371 using _RawTp = typename remove_cv<typename remove_reference<_Tp>::type>::type;
372 using _Maker = __make_tuple_types_flat<_RawTp, typename __make_tuple_indices<_Ep, _Sp>::type>;
373 using type = typename _Maker::template __apply_quals<_Tp>;
376 template <class ..._Types, size_t _Ep>
377 struct __make_tuple_types<tuple<_Types...>, _Ep, 0, true> {
378 typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
381 template <class ..._Types, size_t _Ep>
382 struct __make_tuple_types<__tuple_types<_Types...>, _Ep, 0, true> {
383 typedef _LIBCPP_NODEBUG __tuple_types<_Types...> type;
386 template <bool ..._Preds>
389 template <bool ..._Pred>
390 struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>> {};
392 struct __tuple_sfinae_base {
393 template <template <class, class...> class _Trait,
394 class ..._LArgs, class ..._RArgs>
395 static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>)
396 -> __all<typename enable_if<_Trait<_LArgs, _RArgs>::value, bool>::type{true}...>;
397 template <template <class...> class>
398 static auto __do_test(...) -> false_type;
400 template <class _FromArgs, class _ToArgs>
401 using __constructible = decltype(__do_test<is_constructible>(_ToArgs{}, _FromArgs{}));
402 template <class _FromArgs, class _ToArgs>
403 using __convertible = decltype(__do_test<is_convertible>(_FromArgs{}, _ToArgs{}));
404 template <class _FromArgs, class _ToArgs>
405 using __assignable = decltype(__do_test<is_assignable>(_ToArgs{}, _FromArgs{}));
408 // __tuple_convertible
410 template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
411 bool = __tuple_like<_Up>::value>
412 struct __tuple_convertible
413 : public false_type {};
415 template <class _Tp, class _Up>
416 struct __tuple_convertible<_Tp, _Up, true, true>
417 : public __tuple_sfinae_base::__convertible<
418 typename __make_tuple_types<_Tp>::type
419 , typename __make_tuple_types<_Up>::type
423 // __tuple_constructible
425 template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
426 bool = __tuple_like<_Up>::value>
427 struct __tuple_constructible
428 : public false_type {};
430 template <class _Tp, class _Up>
431 struct __tuple_constructible<_Tp, _Up, true, true>
432 : public __tuple_sfinae_base::__constructible<
433 typename __make_tuple_types<_Tp>::type
434 , typename __make_tuple_types<_Up>::type
438 // __tuple_assignable
440 template <class _Tp, class _Up, bool = __tuple_like<typename remove_reference<_Tp>::type>::value,
441 bool = __tuple_like<_Up>::value>
442 struct __tuple_assignable
443 : public false_type {};
445 template <class _Tp, class _Up>
446 struct __tuple_assignable<_Tp, _Up, true, true>
447 : public __tuple_sfinae_base::__assignable<
448 typename __make_tuple_types<_Tp>::type
449 , typename __make_tuple_types<_Up&>::type
454 template <size_t _Ip, class ..._Tp>
455 struct _LIBCPP_TEMPLATE_VIS tuple_element<_Ip, tuple<_Tp...> >
457 typedef _LIBCPP_NODEBUG typename tuple_element<_Ip, __tuple_types<_Tp...> >::type type;
460 #if _LIBCPP_STD_VER > 11
461 template <size_t _Ip, class ..._Tp>
462 using tuple_element_t _LIBCPP_NODEBUG = typename tuple_element <_Ip, _Tp...>::type;
465 template <bool _IsTuple, class _SizeTrait, size_t _Expected>
466 struct __tuple_like_with_size_imp : false_type {};
468 template <class _SizeTrait, size_t _Expected>
469 struct __tuple_like_with_size_imp<true, _SizeTrait, _Expected>
470 : integral_constant<bool, _SizeTrait::value == _Expected> {};
472 template <class _Tuple, size_t _ExpectedSize,
473 class _RawTuple = typename __uncvref<_Tuple>::type>
474 using __tuple_like_with_size _LIBCPP_NODEBUG = __tuple_like_with_size_imp<
475 __tuple_like<_RawTuple>::value,
476 tuple_size<_RawTuple>, _ExpectedSize
479 struct _LIBCPP_TYPE_VIS __check_tuple_constructor_fail {
481 static constexpr bool __enable_explicit_default() { return false; }
482 static constexpr bool __enable_implicit_default() { return false; }
484 static constexpr bool __enable_explicit() { return false; }
486 static constexpr bool __enable_implicit() { return false; }
488 static constexpr bool __enable_assign() { return false; }
490 #endif // !defined(_LIBCPP_CXX03_LANG)
492 #if _LIBCPP_STD_VER > 14
494 template <bool _CanCopy, bool _CanMove>
495 struct __sfinae_ctor_base {};
497 struct __sfinae_ctor_base<false, false> {
498 __sfinae_ctor_base() = default;
499 __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
500 __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
501 __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
502 __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
505 struct __sfinae_ctor_base<true, false> {
506 __sfinae_ctor_base() = default;
507 __sfinae_ctor_base(__sfinae_ctor_base const&) = default;
508 __sfinae_ctor_base(__sfinae_ctor_base &&) = delete;
509 __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
510 __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
513 struct __sfinae_ctor_base<false, true> {
514 __sfinae_ctor_base() = default;
515 __sfinae_ctor_base(__sfinae_ctor_base const&) = delete;
516 __sfinae_ctor_base(__sfinae_ctor_base &&) = default;
517 __sfinae_ctor_base& operator=(__sfinae_ctor_base const&) = default;
518 __sfinae_ctor_base& operator=(__sfinae_ctor_base&&) = default;
521 template <bool _CanCopy, bool _CanMove>
522 struct __sfinae_assign_base {};
524 struct __sfinae_assign_base<false, false> {
525 __sfinae_assign_base() = default;
526 __sfinae_assign_base(__sfinae_assign_base const&) = default;
527 __sfinae_assign_base(__sfinae_assign_base &&) = default;
528 __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
529 __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
532 struct __sfinae_assign_base<true, false> {
533 __sfinae_assign_base() = default;
534 __sfinae_assign_base(__sfinae_assign_base const&) = default;
535 __sfinae_assign_base(__sfinae_assign_base &&) = default;
536 __sfinae_assign_base& operator=(__sfinae_assign_base const&) = default;
537 __sfinae_assign_base& operator=(__sfinae_assign_base&&) = delete;
540 struct __sfinae_assign_base<false, true> {
541 __sfinae_assign_base() = default;
542 __sfinae_assign_base(__sfinae_assign_base const&) = default;
543 __sfinae_assign_base(__sfinae_assign_base &&) = default;
544 __sfinae_assign_base& operator=(__sfinae_assign_base const&) = delete;
545 __sfinae_assign_base& operator=(__sfinae_assign_base&&) = default;
547 #endif // _LIBCPP_STD_VER > 14
549 _LIBCPP_END_NAMESPACE_STD
551 #endif // _LIBCPP___TUPLE