Original Post
I have a ''simple'' problem - but I can''t find an elegent answer.
The problem is that I want to convert a class''s name - as a null terminated string - into a pointer to a newly declared version of this class. (The constructor never takes parameters.)
So for example I want to get to get from "DList" to void * ptr = new DList(). And then theres the nasty bit - the list of classes that it suports has to be extensible at any point in the code - a switch statement is not acceptable.
Calling a macro with the class name after each class you want in the list it will convert or similer is what I''m after.
So far I have one solution - it involves templates, closures, namespaces and a long macro, with a singlton to keep it all company. I''m not even entirelly sure it would work, not to mention how compiler dependent it would be.
Any nice friendly solutions coders?
-Lethe