In the current standard C ++ draft, there is this example in this paragraph relating to the section related to the explicit specialization of templates:
template<class T> struct A {
void f(T);
template<class X1> void g1(T, X1);
template<class X2> void g2(T, X2);
void h(T) { }
};
template<> void A<int>::f(int);
template<class T> template<class X1> void A<T>::g1(T, X1) { }
template<> template<class X1> void A<int>::g1(int, X1);
template<> template<>
void A<int>::g1(int, char);
In (1), it seems that he g1specialized as still a function template in the specialized version of A (A <int>), and in (2) it seems that g1he specialized in his own template set parameters ((int, from A <int>) , char).
, ( , (1) g1 " " "" A, (2 ) g1 ( ).
, :
template<class T> struct A{
int f() { return 1; }
}
template<>
int A<int>::f() { return 2; }
(1) (3) "", "", (2) ().
?
.