How can I do the following, without having to include every class T in this file?:
// ComponentMan.h
class ComponentMan
{
public:
template<class T>
void CreateComponent<T>()
{
T* temp = new T();
}
}
Basically, I want a generic class instantiater. How can I achieve this without including headers everywhere?
You do it the other way round; you include “ComponentMan.h” everywhere you want to use it. e.g.:
foo.h
blah.cpp