If the explicit instantiation is for a member function, a member class or
a static data member of a class template specialization,
the name of the class template specialization in the
qualified-id
for the member name shall be a
simple-template-id. An explicit instantiation shall appear in an enclosing namespace
of its template
. If the name declared in the explicit
instantiation is an unqualified name, the explicit instantiation
shall appear in the namespace where its template is declared or, if that
namespace is inline (
[namespace.def]), any namespace from its enclosing
namespace set
. [
Example 1:
template<class T> class Array { void mf(); };
template class Array<char>;
template void Array<int>::mf();
template<class T> void sort(Array<T>& v) { }
template void sort(Array<char>&);
namespace N {
template<class T> void f(T&) { }
}
template void N::f<int>(int&);
—
end example]