The template typedef trick is documented in GOTW #79. Here is the result:

template<class T>
struct Registry
{
  typedef std::map<std::string, T> Type;
};

Registry<Employee>::Type employeeRoster;
Registry<void (*)(int)>::Type callbacks;
Registry<ClassFactory*>::Type factories;

TypedefTemplateTrick (last edited 2008-02-26 06:29:57 by localhost)

SourceForge.net Logo