Can I make generic function declarations at the start of my header file?
I can do template<class t> t func(t);
then specialize it, but
Template Specialization VS Function Overloading
says not to do that.
Can I make generic function declarations at the start of my header file?
I can do template<class t> t func(t);
then specialize it, but
Template Specialization VS Function Overloading
says not to do that.
First, you can surely declare a template function and then define it, and/or define specializations. But...
Function specializations must be full specializations, that is, you cannot partially specialize a template function. Now, while you can actually specialize the function template, providing overload may have advantages (and disadvantages), but in most cases it will be a better option.
You might want to read this: http://www.gotw.ca/publications/mill17.htm