Based on the textbook ,
template<class T>
void f( T ){;}
template<class T>
void f( T* ){;}
template<>
void f<>(int*){;}
I am also testing the following with VS2010 SP1 without warning.
template<>
void f<int>(int*){;}
Question What method is recommended to use based on the C ++ standard? Method one or two methods?
As you can see, the key, different from the first method and method two, is as follows:
template<>
void f<>(int*){;}
template<>
void f<int>(int*){;}
^^^
Based on the tutorial, we should write the following regular old function:
void f(int*){;}
But this is NOT the question I ask :)
thank
q0987 source
share