"Ganesh" <ga****************@gmail.com> ???????/???????? ? ????????
?????????: news:72**************************@posting.google.c om...
I have a question regarding template specialisation.
Assume I have a generic template class
template <class S, class T>
class A{
void f() {
// Some code here
}
}
I want to specialise the function f() for say A<int, S>.
Do I need to specialise the entire class.
No,if you want to explicitly specialize the function:
template<>
void A<int,float>::f()
{
// blahblah
}
Still,there is no way to"partially specialize the function for the class.
If else how do i specialise just this fn/?
Just like Victor said, overload.Or make the function templated if the design
allows.