I want to write something like
class Element{}; registerClass("element", &Element); class TextNode{} registerClass("text", &TextNode);
and then do so
TextNode text = crateInstance("text"); Element element = crateInstance("element");
Therefore, the registerClass
function should save classes in the map
How can I specify the type of this map?
map<string, ???> classesMap;
or C ++ is such a weak language that it is impossible to save a reference to a class in it?