I have a lot of C++ classes that use the same list of template parameters
template<typename T, typename Index, typename Bool, typename Data, Index n_x, Index n_u, Index n_c, Index n_w>
class A {
...
};
template<typename T, typename Index, typename Bool, typename Data, Index n_x, Index n_u, Index n_c, Index n_w>
class B {
...
};
template<typename T, typename Index, typename Bool, typename Data, Index n_x, Index n_u, Index n_c, Index n_w>
class C {
...
};
You get the idea. Then I instantiate them like
A<T, Index, Bool, Data, n_x, n_u, n_c, n_w> a;
B<T, Index, Bool, Data, n_x, n_u, n_c, n_w> b;
C<T, Index, Bool, Data, n_x, n_u, n_c, n_w> c;
Is there a way to somehow create an alias for this bundle of template parameters so that I don't have to keep re-typing the argument list?
I have something like this in mind...
using Params = T, Index, Bool, Data, n_x, n_u, n_c, n_w;
A<Params> a;
B<Params> b;
C<Params> c;
I realize that I could create a separate class which just defines types, and use that. But I am wondering if there is a way of doing this without defining a new class.
EDIT
I do not want to use macros.
I also do not want to use defaults because that would require ensuring that the defaults are uniform across a bunch of files. I realize that I could define a new header of defaults and just include that in all of the files, but that just seems like bad programming.