2

「不完全な型の無効な使用」の問題に陥ることなく、C ++でそのようなアイデアを実装するにはどうすればよいですか?

class A {
    /*(...) some fields and methods here. */
    class B {
        /*(...) some fields and methods here. */
        friend B A::fun();
    };
    B fun();
};
4

1 に答える 1

3

これは私のために働く:

struct A {
    class B;
    B fun();
    class B {
        friend B A::fun();
    };
};
于 2013-05-05T18:00:19.923 に答える