Controls the issuing of warnings if an overriding function is not declared with a virtual keyword.
#pragma warn_no_explicit_virtual on | off | reset
Listing 10.42 shows an example.
#pragma warn_no_explicit_virtual on
struct A {
virtual void f();
};
struct B {
void f(); // WARNING: override ‘B::f()’ is declared
// without ’virtual’ keyword
}
TIP This warning is not required by the ISO C++ standard, but can help you track down unwanted overrides.
This pragma does not correspond to any panel setting. To check this setting, use __option (warn_no_explicit_virtual), described in Checking Settings. The default setting is off.