I have a curiously repeating boilerplate template class and a derived class, for example:
template<class Derived>
class A {
typedef typename Derived::C D;
D x;
};
class B : public A<B> {
public:
class C { };
};
This cannot be compiled due to the fact that B will not be fully defined when the compiler tries to determine D. How can I achieve a similar result, that is, to have elements of A that have a type defined in B? Or do I need to get C to define outside B?
Dylan source
share