編譯器錯誤 C3766
'type' 必須提供介面方法 'function' 的實作
繼承自介面的類別必須實作介面成員。
範例
下列範例會產生 C3766。
// C3766.cpp
// compile with: /clr /c
delegate void MyDel();
interface struct IFace {
virtual event MyDel ^ E;
};
ref struct Class1 : public IFace {}; // C3766
// OK
ref struct Class2 : public IFace {
virtual event MyDel ^ E {
void add(MyDel ^) {}
void remove(MyDel ^) {}
}
};