class B;
class A
{
int divident,divisor;
friend int B::test();
public:
A(int i,int j):divident(i),divisor(j){}
};
class B
{
public:
int test();
};
int B::test(){}
int main(){return 1;}
它在带有 Mingwin 的 Qt Creator 中引发以下错误。
为什么它会为 B 类的前向声明抛出错误?可能是我犯了一个愚蠢的错误,但我无法找到它。