In this question I unsuccessfully asked how to use different pimpl implementation depending on a template argument.
Maybe this example ilustrates better what I am tr
What you're trying to do is not allowed by the language.
§ 14.7.3.16 (FCD 2010-03-26) states:
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. In such explicit specialization declaration, the keyword template followed by a template-parameter-list shall be provided instead of the template<> preceding the explicit specialization declaration of the member. The types of the template-parameters in the template-parameter-list shall be the same as those specified in the primary template definition.
[ Example:
template class A {
template class B {
template void mf1(T3);
void mf2();
};
};
template <> template
class A::B {
template void mf1(T);
};
template <> template <> template
void A::B::mf1(T t) { }
template template <>
void A::B::mf2() { } // ill-formed; B is specialized but
// its enclosing class template A is not
—end example ]