jeudi 31 octobre 2019

How to get a reference/pointer to a class (not an object)?

I have a std::map where key is string and I want the value to be, not an object, but a reference/pointer to a class which I can instantiate.

std::map<::std::string, ?class_reference?> handlers_;

Once the specific entry is chosen, I want to create instance of the class and execute a member function.

Aucun commentaire:

Enregistrer un commentaire