11.2.1. Exercises: Generics, Algorithms, and Operators

  1. A QStringList is a value container of objects that have lazy copy-on-write. In a way, it is like a pointer-container, but smarter. In Example 11.6, a CaseIgnoreString was added to a QStringList, which required a conversion. Does this require a copy of the actual string data? Why or why not?

  2. Add some more functions to ContactList.

    Figure 11.2.  ContactList UML

    ContactList UML

    operators += and -= should add() and remove() respectively.

    Write some client-code that tests these functions.

[ fromfile: generics.xml id: ex-sorting ]