Explicit specialized specialization of member functions
2 answers
From C ++ standards:
An explicit specialization is declared in a namespace, the template is a member or, for member templates, in the namespace of which the member class or the template of the enclosing class is a member. An explicit specialization of a member function, member class, or static data member of a class template must be declared in the namespace of which the class template is a member.
So, you need to move the specialization outside of definition A. You can try the following:
class A
{
template<typename X, typename Y>
void f()
{ }
};
template<>
void A::f<int, char>()
{ }
0
source to share