Everytime i add the implementation of a template class function outside of the header file, i get an "Undefined reference" linker error to that function.
I can define the function within the template class like:
But if i define it outside of the header file (such as in the associated .cpp file) like this:Code:template <class T> class myClass { ... ... int myFunction(const T& something) { return 1; } };
i get linker errors.Code:template <class T> int myClass<T>::myFunction(const T& something) { return 1; }