June 2009
Intermediate to advanced
288 pages
5h 59m
English
This chapter introduces the concept of iterator: an interface between algorithms and sequential data structures. A hierarchy of iterator concepts corresponds to different kinds of sequential traversals: single-pass forward, multipass forward, bidirectional, and random access.[1] We investigate a variety of interfaces to common algorithms, such as linear and binary search. Bounded and counted ranges provide a flexible way of defining interfaces for variations of a sequential algorithm.
[1] Our treatment of iterators is a further refinement of the one in Stepanov and Lee [1995] but differs from it in several aspects.
Every object has an address: an integer index into computer memory. Addresses allow us to access ...