编译器错误 C3060

“member”:友元函数可能没有使用限定名在类内定义(可能只声明了它)

使用限定名称定义了友元函数,不允许这样做。

下面的示例生成 C3060:

// C3060.cpp
class A {
public:
   void func();
};

class C {
public:
   friend void A::func() { }   // C3060
   // Try the following line and the out of class definition:
   // friend void A::func();
};

// void A::func(){}