有没有办法解决:
class B;
class C {
public:
C() { }
private:
int i;
friend B::B();
};
class B {
public:
B() { }
private:
int i;
friend C::C();
};
给出错误:
prog.cpp:8: error: invalid use of incomplete type ‘struct B’
prog.cpp:1: error: forward declaration of ‘struct B’