Nóta
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as shíniú isteach nó eolairí a athrú.
Teastaíonn údarú chun rochtain a fháil ar an leathanach seo. Is féidir leat triail a bhaint as eolairí a athrú.
'function1': interface method will not be implemented by non-virtual method 'function2'
Remarks
The compiler expected to find the virtual keyword on a method definition.
Example
The following example generates C4374:
// C4374.cpp
// compile with: /clr /W1 /c /WX
public interface class I {
void f();
};
public ref struct B {
void f() {
System::Console::WriteLine("B::f()");
}
};
public ref struct C {
virtual void f() {
System::Console::WriteLine("C::f()");
}
};
public ref struct D : B, I {}; // C4374
public ref struct E : C, I {}; // OK