Put it in the header file.
The member function is still a member of the class template, and you will need to write:
template <typename T> void MyClass<T>::myMethod() { }
Like all template member functions, this is not yet a real function; it generates a real function only when instantiating the class. Thus, complete template definitions should be visible to anyone who instantiates the template, and the usual way to do this is to put everything in the header.
(Note that member functions of class templates are themselves considered function templates, and you can really specify them: template <> void MyClass<int>::myMethod() { } .)
Kerrek SB
source share