Examples
Team LiB
Previous Section Next Section

Examples

Example: Ostrich. If class Bird defines the virtual function Fly and you derive a new class Ostrich (a notoriously flightless bird) from Bird, how do you implement Ostrich::Fly? The answer is, "It depends." If Bird::Fly guarantees success (i.e., provides the no-fail guarantee; see Item 71) because flying is an essential part of the Bird model, then Ostrich is not an adequate implementation of that model.

    Team LiB
    Previous Section Next Section