diff --git a/octa/array.hh b/octa/array.hh index 4c58502..efb1ec6 100644 --- a/octa/array.hh +++ b/octa/array.hh @@ -11,6 +11,7 @@ #include "octa/algorithm.hh" #include "octa/range.hh" #include "octa/string.hh" +#include "octa/internal/tuple.hh" namespace octa { @@ -75,6 +76,31 @@ struct Array { T p_buf[(N > 0) ? N : 1]; }; +template +struct TupleSize>: IntegralConstant {}; + +namespace detail { + template + struct TupleElementBase> { + using Type = T; + }; +} + +template +TupleElement> &get(Array &a) { + return a[I]; +} + +template +const TupleElement> &get(const Array &a) { + return a[I]; +} + +template +TupleElement> &&get(Array &&a) { + return a[I]; +} + } /* namespace octa */ #endif \ No newline at end of file diff --git a/octa/tuple.hh b/octa/tuple.hh index 8ca4029..c06422d 100644 --- a/octa/tuple.hh +++ b/octa/tuple.hh @@ -372,7 +372,7 @@ public: > >::value >> Tuple(AllocatorArg, const Alloc &a, T &&...t): - p_base(detail::MakeTupleIndices(), + p_base(allocator_arg, a, detail::MakeTupleIndices(), detail::MakeTupleTypes(), detail::MakeTupleIndices(), detail::MakeTupleTypes(), diff --git a/octa/utility.hh b/octa/utility.hh index 45b85c2..6c264de 100644 --- a/octa/utility.hh +++ b/octa/utility.hh @@ -170,9 +170,6 @@ Pair::Type, template struct TupleSize>: IntegralConstant {}; -template -struct TupleSize>: IntegralConstant {}; - namespace detail { template struct TupleElementBase<0, Pair> { @@ -184,16 +181,6 @@ namespace detail { using Type = U; }; - template - struct TupleElementBase<0, const Pair> { - using Type = const T; - }; - - template - struct TupleElementBase<1, const Pair> { - using Type = const U; - }; - template struct GetPair; template<> struct GetPair<0> {