class Node {
public:
template<class T> T* GetComponent() {
return new T(this); // actual code is more complicated!
}
Transform* Transform() {
return this->GetComponent<Transform>(); // invalid template argument for 'T', type expected
}
};
しかし、同じメソッドを別の場所から呼び出すとうまくいきます! main() のように。このコードの何が問題なのですか!!!