I am struggling with template specialization for integer parameters, maybe it is simply impossible?
What I tried out:
template< int COUNT, typename REMOVE, typename ...T>
struct RemoveFirstElementsImpl
{
using Type= typename RemoveFirstElementsImpl<COUNT-1, T...>::Type;
};
template< typename ...T>
struct RemoveFirstElementsImpl<0, T...>
{
using Type= TypeContainer<T...>;
};
template < int COUNT, typename ... T >
struct RemoveFirstElements
{
using Type = typename RemoveFirstElementsImpl< COUNT, T...>::Type;
};
Results in
error: partial specialization is not more specialized than the primary template because it replaces multiple parameters with a pack expansion
Then I thought about SFINAE with something like:
template < int COUNT, typename = typename std::enable_if<COUNT==0>::type, typename HEAD, typename ... T >
struct RemoveFirstElements
{
using Type= TypeContainer<T...>;
};
template < int COUNT, typename = void, typename HEAD, typename ... T >
struct RemoveFirstElements
{
using Type= RemoveFirstElements<COUNT-1, T...>
};
But I have no idea how to get the combination of parameter packs and default parameters to run.
Maybe I am on the complete wrong way. What I want to achieve is to get a parameter list where the first n parameters are removed from my TypeContainer which is simply an extended std::tuple. I only need the type itself not any parameters and I need only on the types and not on any object.
typename REMOVE- user2249683