0
我怎麼能做到以下幾點,而不必包含在此文件中的每個T類?:在C++方法中創建模板類?
// ComponentMan.h
class ComponentMan
{
public:
template<class T>
void CreateComponent<T>()
{
T* temp = new T();
}
}
基本上,我想一個通用類instantiater。如何在不加入標題的情況下實現這一目標?
是謝謝你這個作品! – NomenNescio 2011-12-17 16:42:42