template<typename T> inline std::string nameOfClass() { return typeid(T).name();}
_should_ work the way you need for a factory..
class Factory { template<typename T> register() { register(nameOfClass<T>(),&T::create); }}
like that..
but some compilers (vc6 i know), don''t return "T" with typeid(T).name(), but "struct T" or "class T" or whatever else..
wich, in case you want to support vc6, you have to handle (or you have to
Obj* obj = Factory::create("class T");
instead of
Obj* obj = Factory::create("T");
hope that gives an idea.. else, yes.. the #name results in "name"..
If that''s not the help you''re after then you''re going to have to explain the problem better than what you have. - joanusdmentia
davepermen.net