Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

13.2 Redefinition of Virtual Functions

If you make a subclass of an existing class and override a virtual function, make sure that the overriding function has exactly the same signature as the overridden function. This includes any const modifiers!

This problem arises particularly when creating new RWCollectable classes. For example:

The compiler will treat this definition of isEqual() as completely independent of the isEqual() in the base class RWCollectable, because it is missing a const modifier. Hence, if called through a pointer:



Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.