Item-35 Consider Alternatives to Virtual Functions
· โ 7 min read
Alternatives to virtual functions include the NVI idiom (as an example of the Template Method design pattern) and various forms of the Strategy design pattern.
Item-34 Differentiate between inheritance of interface and inheritance of implementation
· โ 6 min read
Item-33 Avoid hiding inherited names
· โ 5 min read
Names in derived classes hide names in base classes, which is not desirable in public inheritance. To fix it, employ using
declarations or forwarding functions to make hidden names visible again.
Item-32 Make sure public inheritance models "Is-A"
· โ 3 min read
Everything that applies to base classes must also apply to derived classes in public inheritance, for every derived class object is a base class object.