编译器警告(等级 1)C4490

“override”:重写说明符的用法不正确;“function”与 ref 基类方法不匹配

override 说明符未正确使用。 例如,你不重写接口函数,而是实现它。

有关详细信息,请参阅重写说明符

示例

以下示例生成 C4490。

// C4490.cpp
// compile with: /clr /c /W1

interface struct IFace {
   void Test();
};

ref struct Class1 : public IFace {
   virtual void Test() override {}   // C4490
   // try the following line instead
   // virtual void Test() {}
};