共用方式為


編譯器錯誤 C3809

'class':Managed 或 WinRT 類型不可以有任何的 friend 函式/類別/介面

Managed 類型和 Windows 執行階段類型不允許 friends。 若要修正這個錯誤,請不要在 Managed 或 Windows 執行階段類型中宣告 friends。

下列範例會產生 C3809:

// C3809a.cpp
// compile with: /clr
ref class A {};

ref class B
{
public:
   friend ref class A;   // C3809
};

int main()
{
}