Begin and End

By convention, all containers will return an iterator to their first value in response to the message begin(), and a past-the-end value in response to end(). These two values can be used in algorithms that take iterators as arguments. For example, the random-shuffle algorithm rearranges the values in a container. The extent of the values is described by two iterator arguments. This third argument, which we will not explain here, is a random number generator.

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