On Sat, 31 Jan 2015 20:39:56 -0500
DSF <nota...@address.here> wrote:
[snip]
> But in this case, yes is appropriate because some functions are
> inline and some are not. Reading again, I have to say no to the
> separate file section. It's a template so they are all in the same
> header file. (They have to be.) They are just not all defined within
> the template declaration. And the header file is included in any TU
> that uses FAList.
If you have some member functions defined within the class template
definition, and some defined outside the class template definition,
check your syntax carefully. The syntax for member functions of class
templates which are defined outside the class definition can be quite
difficult to get right, and doubly so for a function template member of
a class template defined outside the class definition (if you have any
of them).
If you provide some member function definitions within the class
template definition and some outside it, they do not all have to be
within the same header file. However (with the limited exception of
the few compilers that implemented the export keyword), if they are not
all in the same header file, the definitions must still all be visible
to every translation unit which tries to instantiate the class or use
objects of the class. You cannot tuck away the member function
definitions which are provided outside the class template definition in
a ".cc" or ".cpp" file. Separate files which contain such things are
conventionally suffixed with ".tcc" or ".tpp" and to save the sanity of
the user are usually #include'd at the end of the header file. (To the
limited extent that you would usually so #include them in the header
file, you are right that they all "have to be" within the same header
file.)
Chris