samedi 23 juillet 2016

subclass contains a static member that base class uses

In C++11 Is there some way I can define a static member variable in a subclass that is accessed by the (abstract) base class constructor? I've unsuccessfully tried messing with initialization lists, and tried setting a non-static base class pointer to that static subclass member. I'm starting to think I'll have to write a separate constructor for each subclass just so I can do this. Any ideas?

Aucun commentaire:

Enregistrer un commentaire