vendredi 2 octobre 2015

Declare 'virtual' constructor for base and derived class in c++?

Maybe this is a trivial problem: I have a base class B which has a constructor with many (6+) arguments (and it's not stable maybe change in the future). And there are many derived classes inherit from it which also has the same constructor signature, and all of them just do nothing more than the base one.

So the problem is: is there a way to just declare one time in the base and no need to declare in derived classes? Just like a normal virtual function.

I'm using c++11.

Aucun commentaire:

Enregistrer un commentaire