Possible Duplicate:
“Inherited” types using CRTP and typedef
template<typename T>
struct A {
typename T::Sub s;
};
struct B : A<B> {
struct Sub {};
};
Clang is reporting this error:
todo.cc:3:15: error: no type named 'Sub' in 'B'
typename T::Sub s;
~~~~~~~~~~~~^~~
todo.cc:6:12: note: in instantiation of template class 'A<B>' requested here
struct B : A<B> {
^
How can I get this to work?