编译器错误 C3655

“function”:函数已经显式重写

函数只能显式重写一次。 有关详细信息,请参阅显式重写

以下示例生成 C3655:

// C3655.cpp
// compile with: /clr /c
public ref struct B {
   virtual void f();
   virtual void g();
};

public ref struct D : B {
   virtual void f() new sealed = B::f;
   virtual void g() new sealed = B::f;   // C3655
   // try the following line instead
   // virtual void g() new sealed = B::g;
};