编译器错误 C2863

“interface”:接口不能有友元

不允许在接口上声明友元。

以下示例生成 C2863:

// C2863.cpp
// compile with: /c
#include <unknwn.h>

class CMyClass {
   void *f();
};

__interface IMyInterface {
   void g();

   friend int h();   // 2863
   friend interface IMyInterface1;  // C2863
   friend void *CMyClass::f();  // C2863
};