#ifndef TUPLE_SUBSCRIPT_H #define TUPLE_SUBSCRIPT_H #include template< std::size_t > struct Number2Type { }; template< class... Ts > class tupless: public std::tuple { public: template< class... ARGS > tupless(ARGS... args): std::tuple(args...) { } template< std::size_t N > auto operator[](Number2Type) const -> decltype(std::get(std::tuple())) const& { return std::get(*this); } template< std::size_t N > auto operator[](Number2Type) -> decltype(std::get(std::tuple())) & { return std::get(*this); } }; template< int N > constexpr std::size_t chars_to_int(const char (&array)[N], int current = 0, std::size_t acc = 0) { return (current >= N || array[current] == 0) ? acc : chars_to_int(array, current + 1, 10 * acc + array[current] - '0'); }; template constexpr auto operator "" _t() -> Number2Type { return {}; }; #endif //TUPLE_SUBSCRIPT_H