210 ~tuple()
override =
default;
212 template<
typename F_TYPE,
typename S_TYPE>
215 template<
typename... L_TYPES,
typename... R_TYPES>
219 template<
typename F_TYPE,
typename S_TYPE>
222 template<
typename... L_TYPES,
typename... R_TYPES>
232 template<
typename... TYPES>
234 : std::integral_constant<std::size_t, sizeof...(TYPES)> {};
247 template<std::size_t I,
typename... TYPES>
248 struct tuple_element<I,
original::tuple<TYPES...>> {
249 using type = std::tuple_element_t<I, std::tuple<TYPES...>>;
260 template<std::size_t I,
typename... TYPES>
271 template<std::size_t I,
typename... TYPES>
282 template<std::size_t I,
typename... TYPES>
286template<
typename... TYPES>
287template<original::u_
integer I,
typename T>
291template<
typename... TYPES>
292template<original::u_
integer I,
typename T>
294 : cur_elem(std::move(other.cur_elem)) {}
296template<
typename... TYPES>
297template<original::u_
integer I,
typename T>
299 : cur_elem(other.cur_elem) {}
301template<
typename... TYPES>
302template<original::u_
integer I,
typename T>
307 cur_elem = std::move(other.cur_elem);
311template<
typename... TYPES>
312template<original::u_
integer I,
typename T>
313template<original::u_
integer I_DIFF>
315 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
320template<
typename... TYPES>
321template<original::u_
integer I,
typename T>
322template<original::u_
integer I_DIFF>
324 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
329template<
typename... TYPES>
330template<original::u_
integer I,
typename T>
331template<original::u_
integer I_DIFF,
typename E>
333 staticError<outOfBoundError, (I_DIFF > 0)>::asserts();
334 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
336 cur_elem =
static_cast<T
>(e);
339template<
typename... TYPES>
340template<original::u_
integer I,
typename T>
343 if constexpr (Comparable<T>){
344 if (cur_elem != other.cur_elem)
345 return cur_elem < other.cur_elem ? -1 : 1;
350template<
typename... TYPES>
351template<original::u_
integer I,
typename T>
353 std::stringstream ss;
354 if constexpr (I != 0)
356 ss << formatString(cur_elem);
360template<
typename... TYPES>
361template<original::u_
integer I,
typename T,
typename TS>
363 : cur_elem(cur), next(next_elems) {}
365template<
typename... TYPES>
366template<original::u_
integer I,
typename T,
typename TS>
368 : cur_elem(std::move(other.cur_elem)), next(std::move(other.next)) {}
370template<
typename... TYPES>
371template<original::u_
integer I,
typename T,
typename TS>
373 : cur_elem(other.cur_elem), next(other.next) {}
375template<
typename... TYPES>
376template<original::u_
integer I,
typename T,
typename TS>
378 tupleImpl&& other)
noexcept -> tupleImpl&
382 cur_elem = std::move(other.cur_elem);
383 next = std::move(other.next);
387template<
typename... TYPES>
388template<original::u_
integer I,
typename T,
typename TS>
389template<original::u_
integer I_DIFF>
391 if constexpr (I_DIFF == 0){
394 return next.template
get<I_DIFF - 1>();
398template<
typename... TYPES>
399template<original::u_
integer I,
typename T,
typename TS>
400template<original::u_
integer I_DIFF>
402 if constexpr (I_DIFF == 0){
405 return next.template
get<I_DIFF - 1>();
409template<
typename... TYPES>
410template<original::u_
integer I,
typename T,
typename TS>
411template<original::u_
integer I_DIFF,
typename E>
413 if constexpr (I_DIFF == 0){
414 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
416 cur_elem =
static_cast<T
>(e);
418 next.template set<I_DIFF - 1,
E>(e);
422template<
typename... TYPES>
423template<original::u_
integer I,
typename T,
typename TS>
425 const tupleImpl& other)
const ->
integer
427 if constexpr (Comparable<T>){
428 if (cur_elem != other.cur_elem)
429 return cur_elem < other.cur_elem ? -1 : 1;
431 return next.compareTo(other.next);
434template<
typename... TYPES>
435template<original::u_
integer I,
typename T,
typename TS>
437 std::stringstream ss;
438 if constexpr (I != 0)
440 ss << formatString(cur_elem);
441 ss << formatString(next);
445template<
typename... TYPES>
448 : cur_elem(cur), next(next_elems...) {}
450template<
typename... TYPES>
453 : cur_elem(cur), next(nt) {}
455template<
typename... TYPES>
458 : cur_elem(std::move(other.cur_elem)), next(std::move(other.next)) {}
460template<
typename... TYPES>
463 : cur_elem(other.cur_elem), next(other.next) {}
465template<
typename... TYPES>
468 tupleImpl&& other)
noexcept -> tupleImpl&
472 cur_elem = std::move(other.cur_elem);
473 next = std::move(other.next);
477template<
typename... TYPES>
479template<original::u_
integer I_DIFF>
481 if constexpr (I_DIFF == 0){
484 return next.template
get<I_DIFF - 1>();
488template<
typename... TYPES>
490template<original::u_
integer I_DIFF>
492 if constexpr (I_DIFF == 0){
495 return next.template
get<I_DIFF - 1>();
499template<
typename... TYPES>
501template<original::u_
integer I_DIFF,
typename E>
503 if constexpr (I_DIFF == 0){
504 staticError<valueError, !std::is_convertible_v<E, T>>::asserts();
506 cur_elem =
static_cast<T
>(e);
508 next.template set<I_DIFF - 1,
E>(e);
512template<
typename... TYPES>
516 if constexpr (Comparable<T>){
517 if (cur_elem != other.cur_elem)
518 return cur_elem < other.cur_elem ? -1 : 1;
520 return next.compareTo(other.next);
523template<
typename... TYPES>
526 std::stringstream ss;
527 if constexpr (I != 0)
529 ss << formatString(cur_elem);
530 ss << formatString(next);
534template<
typename... TYPES>
537 std::integral_constant<u_integer, BEGIN_IDX>)
const {
538 return tuple<
decltype(this->get<BEGIN_IDX + IDX_S>())...>(this->get<BEGIN_IDX + IDX_S>()...);
541template<
typename... TYPES>
545 std::integer_sequence<u_integer, T_SIZE...>,
546 std::integer_sequence<u_integer, O_SIZE...>)
const {
547 return tuple<TYPES..., O_TYPES...>{this->get<T_SIZE>()..., other.template get<O_SIZE>()...};
550template<
typename... TYPES>
553template<
typename... TYPES>
556template<
typename... TYPES>
559template<
typename... TYPES>
561 if (
this == &other)
return *
this;
562 this->elems = other.elems;
566template<
typename... TYPES>
568 : elems(std::move(other.elems)) {}
570template<
typename... TYPES>
572 if (
this == &other)
return *
this;
573 this->elems = std::move(other.elems);
577template<
typename... TYPES>
582template<
typename... TYPES>
583template<original::u_
integer IDX>
585 return elems.template get<IDX>();
588template<
typename... TYPES>
589template<original::u_
integer IDX>
591 return elems.template get<IDX>();
594template<
typename... TYPES>
595template<original::u_
integer IDX,
typename E>
597 elems.template set<IDX, E>(e);
601template<
typename... TYPES>
602template<original::u_
integer BEGIN_IDX, original::u_
integer N_ELEMS>
604 constexpr bool out_of_bound = BEGIN_IDX >= SIZE || BEGIN_IDX + N_ELEMS > SIZE;
605 staticError<outOfBoundError, out_of_bound>::asserts();
608 std::make_integer_sequence<u_integer, N_ELEMS>{},
609 std::integral_constant<u_integer, BEGIN_IDX>{}
613template<
typename... TYPES>
615 return elems.compareTo(other.elems);
618template<
typename... TYPES>
620 std::stringstream ss;
621 ss << this->className();
622 ss <<
"(" << elems <<
")";
626template<
typename... TYPES>