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?
Add some more functions to ContactList
.
operators +=
and -=
should add()
and remove()
respectively.
Write some client-code that tests these functions.
[ fromfile: generics.xml id: ex-sorting ]
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |