class myclass {
// Definitions of cotrs and dtor...
// ...
// Defining a method of mine that needs a template
template < typename T >
void dosome(T& par);
}
cppファイルでの実装方法は? 私は、TIがこの良いと思った:メンバ関数のテンプレートの管理
template <typename T>
void myclass::dosome<T>(T& par) {
// My code
}
しかし、コンパイラが本当に怒る... は、この文脈での構文は何ですか? Thankyou
はい、それは正しいです、私はしばらくしてから試しました...ありがとうございます。ああ、1つの質問、あなたはどういう意味ですか:「ヘッダーに入れてください」? – Andry
@Andry - http://stackoverflow.com/questions/4111932/where-to-put-a-member-function-templateを参照してください。 – beldaz