P
piffpuff123
Hello!
I have a type defined in a subclass, and I'd like to use it in the
base class. I tried this but it doesn't work:
template <class T> struct Base {
typename T::Type x;
};
struct Derived: public Base<Derived> {
typedef int Type;
};
It seems ok to me.. Why doesn't it work, and what should I do instead?
Thanks!
I have a type defined in a subclass, and I'd like to use it in the
base class. I tried this but it doesn't work:
template <class T> struct Base {
typename T::Type x;
};
struct Derived: public Base<Derived> {
typedef int Type;
};
It seems ok to me.. Why doesn't it work, and what should I do instead?
Thanks!