Example Program-Inventory System

Let us look at an example program to illustrate some of the techniques used by the STL. Imagine we have a business, world wide widget works, which manufactures widgets. here is a description of a widget. Widgets have identification numbers. Two widgets are the same if they have the same number. Because many of the STL containers also require values to be compared to each other, we also define the less than operator so that a widget with a smaller number is less than one with a larger number.

[audio] [real] Text to accompany slide11, in Chapter 16 of An Introduction to Object-Oriented Programming