Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
We recommend using Visual Studio 2017

Compiler Error C3254

 

The latest version of this topic can be found at Compiler Error C3254.

explicit override' : class contains explicit override 'override' but does not derive from an interface that contains the function declaration

When you explicitly override a method, the class that contains the override must derive, directly or indirectly, from the type that contains the function you are overriding.

The following sample generates C3254:

// C3254.cpp  
__interface I  
{  
   void f();  
};  
  
__interface I1 : I  
{  
};  
  
struct A /* : I1 */  
{  
   void I1::f()  
   {   // C3254, uncomment : I1 to resolve this C3254  
   }  
};  
  
int main()  
{  
}  

Show: