I am trying to summarize what I said in the comments on the question, at the request of the OP.
I think [temp.class.spec] / 5 is enough to answer the question.
In particular:
Partial specialization of the template template can be announced or updated in any area of ββthe namespace in which the corresponding primary template can be defined [...].
In this case, that is actually the rule on it where the primary pattern can be defined.
In this example, you are trying to declare (and contextually define, but primarily declare) a partial specialization in a derived class.
Short answer: you cannot define the main template in a derived class, therefore, you also cannot declare a partial specialization in this class.
If it were possible, the following would be possible:
struct FooParent { template <class> struct Bar; }; struct Foo: FooParent { template <class T> struct FooParent::Bar<T*> {}; };
Or this if you prefer:
struct Foo: FooParent { template <class T> struct Bar<T*> {}; };
Unfortunately (?) They are unacceptable, and it would be enough for you to say that your attempt to specialize the template template is also invalid.
In any case, consider a little more.
The main template is part of the Foo member specification (see here for more details).
So the question is - where can I define such a pattern ?, quickly becomes - where can I define any other member of the class ?.
Again, the answer is not in the area of ββa derived class.
I am sure that a language attorney will give you a more direct and direct explanation.
I am also sure that the same language attorney curses me for mentioning the wrong sections of the standard.
Anyway, I hope that the few examples above can give you a base point from which to start.
skypjack
source share