I have something like that based on variadic templates:
class MyClass {
public:
template <typename... OtherTs>
typename std::enable_if<sizeof...(OtherTs) == 0>::type Setup() {}
template <typename T, typename...OtherTs>
void Setup() {
DoSomeStuff(new T());
Setup<OtherTs>();
}
};
It's working well and I can setup an instantiation of MyClass based on other classes like that myClass.Setup<A,B,C>().
What I would like to do now is to define subpackages of classes like Default = A, B such that myClass.Setup<Default, C>() or even myClass.Setup<MyClass::Default, C>() will be interpreted as myClass.Setup<A,B,C>().
I know I can define #define Default A, B but is there a similar way that does not rely on macro and could be defined in a namespace/class?
Thanks for reading and have a nice day. :)