A
Alan
Does a template class declaration, like
template <class T>
have to come immediately prior to the declaration of the function,
e.g.,
T do_something (T something)
{ . . . }
that uses it?
I have not found anywhere where this rule is written down, but
my compiler seems to work that way. Every other declaration seems to
be able to be reused later. If template worked this way, then one
declaration of the template class would suffice for numerous function
declarations.
My understanding of templates and compilers is not very deep.
Thanks, Alan
template <class T>
have to come immediately prior to the declaration of the function,
e.g.,
T do_something (T something)
{ . . . }
that uses it?
I have not found anywhere where this rule is written down, but
my compiler seems to work that way. Every other declaration seems to
be able to be reused later. If template worked this way, then one
declaration of the template class would suffice for numerous function
declarations.
My understanding of templates and compilers is not very deep.
Thanks, Alan