typedef which can be inherited, but isn't available from inside

I've tried to sort this out before, but came back with the
following example:

1
2
3
4
5
6
7
8
9
10
11
// CAN later access from outside an inherited typedef
template <int N>
struct tdBase { typedef int Xtype; };
template <int N>
struct tdDeri: public tdBase<N>
{
   // BUT
   //Xtype xx = 112; // not declared!
};

const tdDeri<0>::Xtype i = 123;

Why can't it compile?:
Xtype xx = 112;
You have to write typename tdBase<N>::Xtype xx = 112;
I know that. What I desire to read is an explanation of the reasons
why C++ is in that way... Seem like a flaw...
Topic archived. No new replies allowed.