Udostępnij za pomocą


Ostrzeżenie kompilatora (poziom 1) C4374

"function1": metoda interfejsu nie zostanie zaimplementowana przez metodę inną niż wirtualna "function2"

Uwagi

Kompilator oczekuje znalezienia wirtualnego słowa kluczowego w definicji metody.

Example

Poniższy przykład generuje 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