217 ~tuple()
override =
default;
219 template<
typename F_TYPE,
typename S_TYPE>
222 template<
typename F_TYPE,
typename S_TYPE>
225 template<
typename... L_TYPES,
typename... R_TYPES>
228 template<
typename... L_TYPES,
typename... R_TYPES>
231 template<
typename... L_TYPES,
typename... R_TYPES>
234 template<
typename... L_TYPES,
typename... R_TYPES>
238 template<
typename F_TYPE,
typename S_TYPE>
241 template<
typename F_TYPE,
typename S_TYPE>
244 template<
typename... L_TYPES,
typename... R_TYPES>
247 template<
typename... L_TYPES,
typename... R_TYPES>
250 template<
typename... L_TYPES,
typename... R_TYPES>
253 template<
typename... L_TYPES,
typename... R_TYPES>
263 template<
typename... TYPES>
265 : std::integral_constant<std::size_t, sizeof...(TYPES)> {};
278 template<std::size_t I,
typename... TYPES>
279 struct tuple_element<I,
original::tuple<TYPES...>> {
280 using type = std::tuple_element_t<I, std::tuple<TYPES...>>;
291 template<std::size_t I,
typename... TYPES>
302 template<std::size_t I,
typename... TYPES>
313 template<std::size_t I,
typename... TYPES>
317template <
typename ... TYPES>
318template <original::u_
integer I,
typename T>
320 : cur_elem(std::forward<T>(cur)) {}
322template<
typename... TYPES>
323template<original::u_
integer I,
typename T>
325 : cur_elem(std::move(other.cur_elem)) {}
327template<
typename... TYPES>
328template<original::u_
integer I,
typename T>
330 : cur_elem(other.cur_elem) {}
332template<
typename... TYPES>
333template<original::u_
integer I,
typename T>
338 cur_elem = std::move(other.cur_elem);
342template<
typename... TYPES>
343template<original::u_
integer I,
typename T>
344template<original::u_
integer I_DIFF>
346 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
351template<
typename... TYPES>
352template<original::u_
integer I,
typename T>
353template<original::u_
integer I_DIFF>
355 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
360template<
typename... TYPES>
361template<original::u_
integer I,
typename T>
362template<original::u_
integer I_DIFF,
typename E>
364 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
365 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
367 cur_elem =
static_cast<T
>(e);
370template<
typename... TYPES>
371template<original::u_
integer I,
typename T>
374 if constexpr (Comparable<T>){
375 if (cur_elem != other.cur_elem)
376 return cur_elem < other.cur_elem ? -1 : 1;
381template<
typename... TYPES>
382template<original::u_
integer I,
typename T>
384 std::stringstream ss;
385 if constexpr (I != 0)
387 ss << formatString(cur_elem);
391template <
typename ... TYPES>
392template <original::u_
integer I,
typename T,
typename TS>
394 : cur_elem(std::forward<T>(cur)), next(std::forward<TS>(next_elems)) {}
396template<
typename... TYPES>
397template<original::u_
integer I,
typename T,
typename TS>
399 : cur_elem(std::move(other.cur_elem)), next(std::move(other.next)) {}
401template<
typename... TYPES>
402template<original::u_
integer I,
typename T,
typename TS>
404 : cur_elem(other.cur_elem), next(other.next) {}
406template<
typename... TYPES>
407template<original::u_
integer I,
typename T,
typename TS>
409 tupleImpl&& other)
noexcept -> tupleImpl&
413 cur_elem = std::move(other.cur_elem);
414 next = std::move(other.next);
418template<
typename... TYPES>
419template<original::u_
integer I,
typename T,
typename TS>
420template<original::u_
integer I_DIFF>
422 if constexpr (I_DIFF == 0){
425 return next.template
get<I_DIFF - 1>();
429template<
typename... TYPES>
430template<original::u_
integer I,
typename T,
typename TS>
431template<original::u_
integer I_DIFF>
433 if constexpr (I_DIFF == 0){
436 return next.template
get<I_DIFF - 1>();
440template<
typename... TYPES>
441template<original::u_
integer I,
typename T,
typename TS>
442template<original::u_
integer I_DIFF,
typename E>
444 if constexpr (I_DIFF == 0){
445 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
447 cur_elem =
static_cast<T
>(e);
449 next.template set<I_DIFF - 1,
E>(e);
453template<
typename... TYPES>
454template<original::u_
integer I,
typename T,
typename TS>
456 const tupleImpl& other)
const ->
integer
458 if constexpr (Comparable<T>){
459 if (cur_elem != other.cur_elem)
460 return cur_elem < other.cur_elem ? -1 : 1;
462 return next.compareTo(other.next);
465template<
typename... TYPES>
466template<original::u_
integer I,
typename T,
typename TS>
468 std::stringstream ss;
469 if constexpr (I != 0)
471 ss << formatString(cur_elem);
472 ss << formatString(next);
476template <
typename ... TYPES>
479 : cur_elem(std::forward<T>(cur)), next(std::forward<TS>(next_elems)...) {}
481template<
typename... TYPES>
484 : cur_elem(cur), next(nt) {}
486template<
typename... TYPES>
489 : cur_elem(std::move(other.cur_elem)), next(std::move(other.next)) {}
491template<
typename... TYPES>
494 : cur_elem(other.cur_elem), next(other.next) {}
496template<
typename... TYPES>
499 tupleImpl&& other)
noexcept -> tupleImpl&
503 cur_elem = std::move(other.cur_elem);
504 next = std::move(other.next);
508template<
typename... TYPES>
510template<original::u_
integer I_DIFF>
512 if constexpr (I_DIFF == 0){
515 return next.template
get<I_DIFF - 1>();
519template<
typename... TYPES>
521template<original::u_
integer I_DIFF>
523 if constexpr (I_DIFF == 0){
526 return next.template
get<I_DIFF - 1>();
530template<
typename... TYPES>
532template<original::u_
integer I_DIFF,
typename E>
534 if constexpr (I_DIFF == 0){
535 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
537 cur_elem =
static_cast<T
>(e);
539 next.template set<I_DIFF - 1,
E>(e);
543template<
typename... TYPES>
547 if constexpr (Comparable<T>){
548 if (cur_elem != other.cur_elem)
549 return cur_elem < other.cur_elem ? -1 : 1;
551 return next.compareTo(other.next);
554template<
typename... TYPES>
557 std::stringstream ss;
558 if constexpr (I != 0)
560 ss << formatString(cur_elem);
561 ss << formatString(next);
565template<
typename... TYPES>
568 std::integral_constant<u_integer, BEGIN_IDX>)
const {
569 return tuple<
decltype(this->get<BEGIN_IDX + IDX_S>())...>(this->get<BEGIN_IDX + IDX_S>()...);
572template<
typename... TYPES>
576 std::integer_sequence<u_integer, T_SIZE...>,
577 std::integer_sequence<u_integer, O_SIZE...>)
const {
578 return tuple<TYPES..., O_TYPES...>{TYPES(this->get<T_SIZE>())..., O_TYPES(other.template get<O_SIZE>())...};
581template<
typename... TYPES>
585 std::integer_sequence<u_integer, T_SIZE...>,
586 std::integer_sequence<u_integer, O_SIZE...>)
const {
587 return tuple<TYPES..., O_TYPES...>{
588 std::forward<
decltype(this->get<T_SIZE>())>(this->get<T_SIZE>())...,
589 std::forward<
decltype(other.template get<O_SIZE>())>(other.template get<O_SIZE>())...
593template <
typename ... TYPES>
595 : elems(std::forward<TYPES>(e)...) {}
597template<
typename... TYPES>
600template<
typename... TYPES>
602 if (
this == &other)
return *
this;
603 this->elems = other.elems;
607template<
typename... TYPES>
609 : elems(std::move(other.elems)) {}
611template<
typename... TYPES>
613 if (
this == &other)
return *
this;
614 this->elems = std::move(other.elems);
618template<
typename... TYPES>
623template<
typename... TYPES>
624template<original::u_
integer IDX>
626 return elems.template get<IDX>();
629template<
typename... TYPES>
630template<original::u_
integer IDX>
632 return elems.template get<IDX>();
635template<
typename... TYPES>
636template<original::u_
integer IDX,
typename E>
638 elems.template set<IDX, E>(e);
642template<
typename... TYPES>
643template<original::u_
integer BEGIN_IDX, original::u_
integer N_ELEMS>
645 constexpr bool out_of_bound = BEGIN_IDX >= SIZE || BEGIN_IDX + N_ELEMS > SIZE;
646 staticError<outOfBoundError, out_of_bound>::asserts();
649 std::make_integer_sequence<u_integer, N_ELEMS>{},
650 std::integral_constant<u_integer, BEGIN_IDX>{}
654template<
typename... TYPES>
656 return elems.compareTo(other.elems);
659template<
typename... TYPES>
661 std::stringstream ss;
662 ss << this->className();
663 ss <<
"(" << elems <<
")";
667template<
typename... TYPES>