A local class of non-closure type shall not have member templates
. A destructor shall not be a member
template
. A non-template member function (
[dcl.fct]) with a given name
and type and a member function template of the same name, which could be
used to generate a specialization of the same type, can both be
declared in a class
. When both exist, a use of that name and type refers to the
non-template member unless an explicit template argument list is supplied
. [
Example 3:
template <class T> struct A {
void f(int);
template <class T2> void f(T2);
};
template <> void A<int>::f(int) { }
template <> template <> void A<int>::f<>(int) { }
int main() {
A<char> ac;
ac.f(1);
ac.f('c');
ac.f<>(1);
}
—
end example]