See Section 6.8.2, page 228, for an example that demonstrates how to sort according to a member of
a class.
The following program demonstrates how sort() and stable_sort() differ. The program
uses both algorithms to sort strings only according to their number of characters by using the sorting
criterion lessLength():
www.it-ebooks.info