Would any one knows according to what rules code below doesn\'t compile?
template
struct B
{
typedef T type;
};
template
You need to use typename keyword as,
template
struct X::type*>
{
};
It's because B is a dependent name. So typename is required!
--
EDIT:
Even after putting typename, it isn't compiling. I think it's because deduction of type T in B from X is difficult, or possibly impossible, for the compiler. So I believe its non-deduced context.
See a similar example here and the discussion:
Template parameters in non-deduced contexts in partial specializations
However, if you change the specialization to this:
template
struct X >
{
};
Then it becomes the deducible context, and so would compile.