The C++ standard states the following:
In an explicit specialization declaration for a member of a class template or a member template that appears in namespace scope, the member template and some of its enclosing class templates may remain unspecialized, except that the declaration shall not explicitly specialize a class member template if its enclosing class templates are not explicitly specialized as well. (14.7.3/16 since C++11 and 14.7.3/18 in older standards)
This means that the following is not possible:
template<typename T>
class foo {
template<typename U>
void bar();
};
template<typename T>
template<>
void foo<T>::bar<some_type>(){
}
There have already been multiple questions of people having problems related to this, which were answered more or less by "the standard says so". What I don't really understand is why this restriction exists.