The presence of
protected is not enough to define the interface seen by a derived class, just as a class definition by itself is not enough to specify the interface seen by clients. The interfaces seen by clients and derived classes have a semantic component as well as a syntactic one; the C++ syntax often expresses only a small fraction of the total interface. If a function can be overridden, you must state so explicitly in the class specification (unless it's a pure virtual function). Your interface must be thought through and well documented. The next two sections go into more detail.
[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.