In my personal project, I have something like this:
template <typename T>
class Base {
} ;
template <typename T>
class DerivedA : public Base<T> {
} ;
template <typename T>
class DerivedB : Base<T> {
} ;
class Entity : public DerivedA<int>, DerivedA<char>, DerivedB<float> {
};
A "base" class is a kind of adapter that allows me to see "Entity" as an int, a char, float, or whatever I want. DerivedA and DerivedB have different conversion methods. Then I have a class that allows me to store various representations of my object as follows:
template <typename... Args>
class BaseManager {
public:
void store(Args*... args){
}
};
I have many different "Entity" classes that have different "base" collections. I want to be able to store a list of types in an alias like:
class EntityExtra : public DerivedA<int>, DerivedA<char>, DerivedB<float>{
public:
using desiredBases = Base<int>, Base<char>, Base<float>;
};
Therefore, I can use it as follows:
EntityExtra ee;
BaseManager<Base<int>, Base<char>, Base<float> > bm;
BaseManager<EntityExtra::desiredBases> bm;
bm.store(&ee,&ee,&ee);
Is there a way to make an alias for an arbitrary type list and then use it in a template parameter package?