mardi 29 octobre 2019

Inherit from classes passed to constructor as a template parameters an inherit from them

I want to have something like that:

template<class... Args>
class MyClass : public Args
{
    MyClass<class... Args>(/*some parameters*/)
    { }
}

// ana then:
MyClass<Base1, Base2, Base3>(/*some arguments*/)

That i want to dynamic_cast to Base1 or etc. and to use his methods.

I know that this code will not work, but do you have any ideas how to do it?

Aucun commentaire:

Enregistrer un commentaire