I want to create a class B that inherits from template class A. And I want the B's nested class E to be the template parameter in this inheritance. More visually:
template <class T>
class A {
}
class B : public A<B::E> {
class E {
int x;
}
}
class C : public A<C::E> {
class E {
int x;
int y;
}
}
I think the problem is that the compiler doesn't know that the class B will have a nested class E by the time it's processing the declaration of B, since I'm getting the error:
no member named 'E' in 'B'
I've seen this similar question, but I would like to confirm that there's no direct solution to this conflict before giving up with this approach.
Thanks!