how can I implement such an idea in C++ without getting into "invalid use of incomplete type" trouble?
class A {
/*(...) some fields and methods here. */
class B {
/*(...) some fields and methods here. */
friend B A::fun();
};
B fun();
};