Original Post
Hey people !
I was wondering, if I construct a class holding a custom item through template< typename T > and split the class up into a header and source file, do I need to put the template before each of the member function definitions in the source file?
I was getting "Error: argument list for class template "CFoo" is missing" for each of the member functions and pasting the template before them seemed to solve the error, but I'm unsure if I've missinterpreted the use of templates :S
I was wondering, if I construct a class holding a custom item through template< typename T > and split the class up into a header and source file, do I need to put the template before each of the member function definitions in the source file?
// CFoo.htemplate< typename T >class CFoo{public: CFoo( T item ); void Process();private: T m_item;};// CFoo.cpptemplate< typename T > // Like this?CFoo::CFoo( T item ){ ... }template< typename T > // Like this? Even when there is no occurence of T in the function?void CFoo::Process(){ ... }I was getting "Error: argument list for class template "CFoo" is missing" for each of the member functions and pasting the template before them seemed to solve the error, but I'm unsure if I've missinterpreted the use of templates :S