I have a template class that takes a large number of template parameters.
This is an helper class that is used only on a predefined list of types.
I use a type alias (using
or typedef
) so that the user does not get polluted with the template suff.
As the typelist is hardcoded, I would like to force the instantiation of the class T, but as the list is quite long I'd like to force instantiation without repeating all parameters.
How could I do that?
template <class... X>
class T {
};
// alias the type so that the user don't get mad with type list
using Z = T<int, bool, char, long
/* possibly a long list of parameters*/ >;
// this works but needs to repeat all template arguments
template class T<int, bool, char, long>;
// how to force instantiation of T using Z?