I have two classes. A, and B. B has a member field of type A. A has a member method that returns an object of type B.
You can't define members of a class with a type that doesn't have a complete definition.
My current solution is lame. Defer that type by using a template argument.
Is there a way around that?
template <class T>
struct B {
T a;
};
struct A {
B<A> foo(){
B<A> result;
return result;
}
};