Quote Originally Posted by laserlight View Post
It looks like you use node_t as if it were in the global namespace or in scope, but actually the node_t struct is nested inside ABC, thus you should write:
Code:
template <class T>
typename ABC<T>::node_t *ABC<T>::new_node(T element) {
Thanks, unfortunately that moved the problem on to other errors like:

error: expected initializer before ‘struct’
error: expected constructor, destructor, or type conversion before ‘->’ token

I will try to create a small compilable example that replicates this and get back.

Quote Originally Posted by laserlight View Post
Exceptions are made for inline functions and for templates (although there are exceptions to this exception as well).
That's interesting, but is the idea that it's better to keep it separated (in case of templates) if possible?

Quote Originally Posted by jimblumberg View Post
Not when dealing with templates.

Quite true. Just like member functions of non-template classes defined outside the class must be properly parameterized.


Usually a single compilation unit is one file. However you can use multiple files by including the implementation in the include file (after the class definition).

You may find this link informative Templates C++ Documentation, be sure you scroll down to the bottom of this page and read the section titled: "Templates and multiple-file projects".
Thanks, that's interesting but seemingly at odds with "The C++ programming language" Stroustrup.

Members of a template class are declared and defined exactly as they would have been for a non-template class. A template member need not be defined within the template class itself. In that case, it's definition must be provided somewhere else, as for non-template class members (§C.13.7). Page 330, 13.2.1
I may try to just move the offending function to the header, if that helps.