PPT Slide
class ExtendedWhole : private Whole {public: /* Omit constructors & assignment */
void swap(const ExtendedWhole& rhs);
void setParts( const PartOne& p1, const PartTwo& p2, const PartThree& p3);
private: int count; PartThree body;};
Notes:
The examples we’ve looked at so far are a sufficient guide to writing the constructors and assignment operators. So we are going to focus on two methods:
The swap() member function and,
A setParts() method that updates the parts.