I need to generate a tuple of class templates given an integer list as a variadic argument. The result I want to achieve is presented in the example below, but doesn´t compile:
template <unsigned int First, unsigned int... Is>
using remove_first = std::integer_sequence<unsigned int, Is...>;
template <unsigned int... Is, unsigned int Last> // Invalid
using remove_last = std::integer_sequence<unsigned int, Is...>;
template <unsigned int N_prev, unsigned int N>
class A
{};
template <unsigned int... Is>
class B
{
std::tuple<A<remove_last<Is>, remove_first<Is>>...> object;
};
int main()
{
B<3, 4, 6, 2> b; // <<= b.object is of type: std::tuple<A<3,4>, A<4,6>, A<6,2>>
}
Is it possible to achieve in a similar way?