I have code such as
template <class T> class Widget
{
void fun() {}
}
//Okay: specialization of a member function of widget
template <> void Widget<char>:: fun()
{
void fun() {}
}
But, below is error as I am been told. But not understand why.
template<class T, class U> class Gadget
{
void fun() {}
}
//Error! cannot partially specialize a member function of Gadget
template<class U> void Gadget<char,U>::fun()
{
..specialized implementation
}
Why is the second wrong? how to change it to make it right? thanks!!!!