[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Finding Hidden Virtual Functions

If the Hidden virtual functions option is on, the compiler generates a warning if you declare a non-virtual member function in a subclass that hides an inherited virtual function in a superclass. One function hides another if it has the same name but a different argument types. For example:
class A {
public:
virtual void f(int);
virtual void g(int);
};
class B: public A {
public:
void f(char); // WARNING: Hides A::f(int)
virtual void g(int); // OK: Overrides A::g(int)
};
The Hidden virtual functions option corresponds to the pragma warn_hidevirtual, described at "warn_hidevirtual." To check whether this option is on, use __option (warn_hidevirtual). See "Checking Options" for information on how to use this directive.
[ First ] [ Previous ] [ Next ] [ Last ] [ Manuals ]
Visit the Metrowerks website at: http://www.metrowerks.com
For assistance contact Metrowerks Technical Support at: cw_support@metrowerks.com
Copyright © 2000, Metrowerks Corp. All rights reserved.
Last updated: August 17, 2000