I need to specialize a function template in c++.
template<typename T>
void doStuff<T>() {}
To
template<>
void doStuff<DefinedClass>();
and
template<>
void doStuff<DefinedClass2>();
I guess that is not the correct syntax (since it is not compiling). How should I do it?
Also, Since I will have not undefined template parameters in doStuff<DefinedClass>
, would it be possible to declare the body in a .cpp?
Note: doStuff will use T wihtin its body to declare a variable.