Remember, making something virtual does not mean it can be overridden; whether and how member functions can be overridden must be stated in the class definition.
Of course, if you are sure that you will never have derived classes, or that a given function should never be overridden, you don't need to make your functions virtual. You can find examples in the Taligent Application Environment, including TGPoint, TToken, and the
NOTE
Inline functions can be virtual. When the compiler knows the type of the object at compile time, it generates the inline; when it does not (such as when a pointer or reference is used), it calls the function through a virtual dispatch. See "Virtual inline functions where the type is not known" on page 93 for more on this.
complex
class. And if your class can afford an extra function call, you can add a virtual version later and have the nonvirtual version call it.
[Contents]
[Previous]
[Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.