220struct tuple<This, Rest...> :
private tuple<Rest...>,
public icommon<tuple<This, Rest...>> {
235 template <
typename Tuple,
size_t... Idx>
238 template <
typename... Args>
250 template <
typename Tag,
typename U1,
typename... U2,
252 constexpr tuple(Tag , U1&& this_arg, U2&&... rest_arg) :
254 data_(_NEFORCE
forward<U1>(this_arg)) {}
264 template <
typename Tag,
typename Tuple,
size_t... Index,
274 template <typename Tag, typename Tuple, enable_if_t<is_same<Tag, unpack_utility_construct_tag>::value,
int> = 0>
275 constexpr tuple(Tag , Tuple&& tup) :
280#ifdef NEFORCE_STANDARD_20
285 template <
typename T = This,
300 template <
typename T = This,
301 enable_if_t<inner::tuple_constructible<tuple,
const T&,
const Rest&...>::value,
int> = 0>
302 constexpr explicit(inner::tuple_explicitly_convertible<tuple,
const T&,
const Rest&...>::value)
303 tuple(
const T& this_arg,
const Rest&... rest_arg)
noexcept(
314 template <
typename U1,
typename... U2,
316 inner::tuple_constructible<tuple, U1, U2...>>,
318 constexpr explicit(inner::tuple_explicitly_convertible<tuple, U1, U2...>::value)
320 U2&&... rest_arg)
noexcept(inner::tuple_nothrow_constructible<tuple, U1, U2...>::value) :
329 inner::tuple_convertible<tuple,
const tuple<U...>&, U...>>,
331 constexpr explicit(inner::tuple_explicitly_convertible<tuple,
const U&...>::value)
332 tuple(
const tuple<U...>& tup)
noexcept(inner::tuple_nothrow_constructible<tuple,
const U&...>::value) :
341 inner::tuple_convertible<tuple, tuple<U...>, U...>>,
343 constexpr explicit(inner::tuple_explicitly_convertible<tuple, U...>::value)
344 tuple(tuple<U...>&& tup)
noexcept(inner::tuple_nothrow_constructible<tuple, U...>::value) :
353 template <
typename T1,
typename T2,
355 constexpr explicit(inner::tuple_explicitly_convertible<tuple, const T1&, const T2&>::value) tuple(
356 const pair<T1, T2>& pir)
noexcept(inner::tuple_nothrow_constructible<tuple, const T1&, const T2&>::value) :
365 template <typename T1, typename T2, enable_if_t<inner::tuple_constructible<tuple, T1, T2>::value,
int> = 0>
366 constexpr explicit(inner::tuple_explicitly_convertible<tuple, T1, T2>::value)
367 tuple(
pair<T1, T2>&& pir)
noexcept(inner::tuple_nothrow_constructible<tuple, T1, T2>::value) :
370 template <
typename T = This,
375 explicit tuple() noexcept(
380 template <
typename T = This,
382 conjunction<is_implicitly_default_constructible<T>,
383 is_implicitly_default_constructible<Rest>...>::value,
386 conjunction<is_nothrow_default_constructible<T>, is_nothrow_default_constructible<Rest>...>::value) :
390 template <
typename T = This,
391 enable_if_t<inner::tuple_constructible<tuple,
const T&,
const Rest&...>::value &&
392 inner::tuple_explicitly_convertible<tuple,
const T&,
const Rest&...>::value,
394 explicit tuple(
const T& this_arg,
const Rest&... rest_arg)
noexcept(
395 conjunction<is_nothrow_copy_constructible<T>, is_nothrow_copy_constructible<Rest>...>::value) :
396 tuple(exact_arg_construct_tag{}, this_arg, rest_arg...) {}
398 template <
typename T = This,
399 enable_if_t<inner::tuple_constructible<tuple,
const T&,
const Rest&...>::value &&
400 !inner::tuple_explicitly_convertible<tuple,
const T&,
const Rest&...>::value,
402 tuple(
const T& this_arg,
const Rest&... rest_arg)
noexcept(
403 conjunction<is_nothrow_copy_constructible<T>, is_nothrow_copy_constructible<Rest>...>::value) :
404 tuple(exact_arg_construct_tag{}, this_arg, rest_arg...) {}
406 template <
typename U1,
typename... U2,
407 enable_if_t<conjunction<inner::tuple_constructible<tuple, U1, U2...>,
408 inner::tuple_convertible<tuple, U1, U2...>>::value &&
409 inner::tuple_explicitly_convertible<tuple, U1, U2...>::value,
411 explicit tuple(U1&& this_arg,
412 U2&&... rest_arg)
noexcept(inner::tuple_nothrow_constructible<tuple, U1, U2...>::value) :
413 tuple(exact_arg_construct_tag{}, _NEFORCE
forward<U1>(this_arg), _NEFORCE
forward<U2>(rest_arg)...) {}
415 template <
typename U1,
typename... U2,
416 enable_if_t<conjunction<inner::tuple_constructible<tuple, U1, U2...>,
417 inner::tuple_convertible<tuple, U1, U2...>>::value &&
418 !inner::tuple_explicitly_convertible<tuple, U1, U2...>::value,
420 tuple(U1&& this_arg, U2&&... rest_arg)
noexcept(inner::tuple_nothrow_constructible<tuple, U1, U2...>::value) :
421 tuple(exact_arg_construct_tag{}, _NEFORCE
forward<U1>(this_arg), _NEFORCE
forward<U2>(rest_arg)...) {}
423 template <
typename... U,
424 enable_if_t<conjunction<inner::tuple_constructible<tuple,
const U&...>,
425 inner::tuple_convertible<tuple,
const tuple<U...>&, U...>>::value &&
426 inner::tuple_explicitly_convertible<tuple,
const U&...>::value,
428 explicit tuple(
const tuple<U...>& tup)
noexcept(inner::tuple_nothrow_constructible<tuple,
const U&...>::value) :
429 tuple(unpack_utility_construct_tag{}, tup) {}
431 template <
typename... U,
432 enable_if_t<conjunction<inner::tuple_constructible<tuple,
const U&...>,
433 inner::tuple_convertible<tuple,
const tuple<U...>&, U...>>::value &&
434 !inner::tuple_explicitly_convertible<tuple,
const U&...>::value,
436 tuple(
const tuple<U...>& tup)
noexcept(inner::tuple_nothrow_constructible<tuple,
const U&...>::value) :
437 tuple(unpack_utility_construct_tag{}, tup) {}
439 template <
typename... U,
enable_if_t<conjunction<inner::tuple_constructible<tuple, U...>,
440 inner::tuple_convertible<tuple, tuple<U...>, U...>>::value &&
441 inner::tuple_explicitly_convertible<tuple, U...>::value,
443 explicit tuple(tuple<U...>&& tup)
noexcept(inner::tuple_nothrow_constructible<tuple, U...>::value) :
444 tuple(unpack_utility_construct_tag{}, _NEFORCE
move(tup)) {}
446 template <
typename... U,
enable_if_t<conjunction<inner::tuple_constructible<tuple, U...>,
447 inner::tuple_convertible<tuple, tuple<U...>, U...>>::value &&
448 !inner::tuple_explicitly_convertible<tuple, U...>::value,
450 tuple(tuple<U...>&& tup)
noexcept(inner::tuple_nothrow_constructible<tuple, U...>::value) :
451 tuple(unpack_utility_construct_tag{}, _NEFORCE
move(tup)) {}
453 template <
typename T1,
typename T2,
454 enable_if_t<inner::tuple_constructible<tuple, const T1&, const T2&>::value &&
455 inner::tuple_explicitly_convertible<tuple, const T1&, const T2&>::value,
457 explicit tuple(
const pair<T1, T2>& pir)
noexcept(
458 inner::tuple_nothrow_constructible<tuple, const T1&, const T2&>::value) :
459 tuple(unpack_utility_construct_tag{}, pir) {}
461 template <
typename T1,
typename T2,
462 enable_if_t<inner::tuple_constructible<tuple, const T1&, const T2&>::value &&
463 !inner::tuple_explicitly_convertible<tuple, const T1&, const T2&>::value,
465 tuple(
const pair<T1, T2>& pir)
noexcept(inner::tuple_nothrow_constructible<tuple, const T1&, const T2&>::value) :
466 tuple(unpack_utility_construct_tag{}, pir) {}
468 template <
typename T1,
typename T2,
469 enable_if_t<inner::tuple_constructible<tuple, T1, T2>::value &&
470 inner::tuple_explicitly_convertible<tuple, T1, T2>::value,
472 explicit tuple(pair<T1, T2>&& pir)
noexcept(inner::tuple_nothrow_constructible<tuple, T1, T2>::value) :
473 tuple(unpack_utility_construct_tag{}, _NEFORCE
move(pir)) {}
475 template <
typename T1,
typename T2,
476 enable_if_t<inner::tuple_constructible<tuple, T1, T2>::value &&
477 !inner::tuple_explicitly_convertible<tuple, T1, T2>::value,
479 tuple(pair<T1, T2>&& pir)
noexcept(inner::tuple_nothrow_constructible<tuple, T1, T2>::value) :
480 tuple(unpack_utility_construct_tag{}, _NEFORCE
move(pir)) {}
492 template <
typename T = This,
507 template <
typename T = This,
523 inner::tuple_assignable<tuple,
const U&...>>::value,
525 NEFORCE_CONSTEXPR14 tuple&
526 operator=(
const tuple<U...>& tup)
noexcept(inner::tuple_nothrow_assignable<tuple,
const U&...>::value) {
542 NEFORCE_CONSTEXPR14 tuple&
543 operator=(tuple<U...>&& tup)
noexcept(inner::tuple_nothrow_assignable<tuple, U...>::value) {
545 get_rest() = _NEFORCE
forward<
typename tuple<U...>::super>(tup.get_rest());
556 template <
typename T1,
typename T2,
558 NEFORCE_CONSTEXPR14 tuple&
572 template <typename T1, typename T2, enable_if_t<inner::tuple_assignable<tuple, T1, T2>::value,
int> = 0>
573 NEFORCE_CONSTEXPR14 tuple&
600 template <
typename... U>
601 NEFORCE_NODISCARD
constexpr bool equal_to(
const tuple<U...>& t)
const {
602 return data_ == t.data_ && base_type::equal_to(t.get_rest());
611 template <
typename... U>
612 NEFORCE_NODISCARD
constexpr bool less_than(
const tuple<U...>& rhs)
const {
613 return data_ < rhs.data_ || (!(rhs.data_ < data_) && base_type::less_than(rhs.get_rest()));
616 using icommon<tuple<This, Rest...>>::operator==;
617 using icommon<tuple<This, Rest...>>::operator!=;
618 using icommon<tuple<This, Rest...>>::operator<;
619 using icommon<tuple<This, Rest...>>::operator>;
620 using icommon<tuple<This, Rest...>>::operator<=;
621 using icommon<tuple<This, Rest...>>::operator>=;
623 template <
size_t Index,
typename... Types>
625 template <
size_t Index,
typename... Types>
626 friend constexpr const tuple_element_t<Index, Types...>&
get(
const tuple<Types...>&)
noexcept;
627 template <
size_t Index,
typename... Types>
629 template <
size_t Index, typename... Types>
630 friend constexpr const
tuple_element_t<Index, Types...>&&
get(const tuple<Types...>&&) noexcept;
632 template <
size_t Index, typename... Types>
633 friend constexpr
tuple_element_t<Index, Types...>&& pair_get_from_tuple(tuple<Types...>&&) noexcept;
639 NEFORCE_NODISCARD constexpr
size_t to_hash() const noexcept {
647 NEFORCE_CONSTEXPR14
void
649 _NEFORCE
swap(data_, t.data_);
650 base_type::swap(t.get_rest());