共用方式為


編譯器錯誤 C2863

'interface' : 介面不能有朋友

備註

不允許在介面上宣告friend。

Example

下列範例會產生 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
};