#pragma once namespace { /** * Recursively generates a tuple out of a subsection of another tuple. * * @tparam T - The base tuple to pull the types from. * @tparam N - The current index of the type to add to the resultant tuple. * @tparam M - The end index of types to pull. * @tparam Args - A pack of the args to add into the resultant tuple. * @returns the subsection of the tuple T as specified by M and N. */ template inline constexpr auto tuple_sub_impl() { if constexpr (N <= M) return tuple_sub_impl>(); else return std::tuple {}; } } /** * Struct containing a subsection of a tuple T and start index N and end index M. * * @tparam T - The tuple to take a subsection of. * @tparam N - The start index of the tuple types to include. * @tparam M - The end index of the tuple types to include - defaults to the tuple's size. */ template - 1> struct tuple_sub { /** The value of the subsection of the tuple. */ typedef decltype(tuple_sub_impl()) value_type; }; /** * Shorthand for the value type of tuple_sub with the provided template arguments. */ template - 1> using tuple_sub_t = typename tuple_sub::value_type;