Is it possible to typedef a parameter pack? For example
template<class T, class... Args>
struct A
{
typedef T Type; // We typedef it, then its derived class can use it.
// How about for parameter packs?
// Option 1:
typedef Args Arguments;
// Option 2:
using Arguments = Args;
// Option 3: I can put in a tuple, but how can I untuple it to a pack
typedef tuple<Args...> Tuple;
};
I want to using the above technique to implement the following
template<int... VALUES>
struct IntegralSequence
{
enum { SIZE = sizeof...(VALUES) };
template <unsigned I>
struct At
{
enum { VALUE = typename tuple_element<I,
tuple<integral_constant<int, VALUES>...>>::type::value
};
};
};
template<unsigned N>
struct AscendingSequence
{
typedef IntegralSequence<AscendingSequence<N-1>::VALUES..., N> Type;
using VALUES = Type::VALUES; // if it works
};
template<>
struct AscendingSequence<1>
{
typedef IntegralSequence<0> Type;
using VALUES = Type::VALUES; // if it works
};