Generic iterators
Example from last lecture
The example generalized
Implications
More implications
An example
Making find work with built-in arrays
Generalizing find to other types
What's going on here?
How might this find be more useful?
Defining ranges without counting
Advantages of off-the-end pointers
The next revision of find
Assumptions about type P
We can round out the assumptions
Why no null pointers?
The answer is subtle
Another reason to return end
Input iterator requirements
Output iterator requirements
Using input and output iterators
A copy example
Why is this abstraction useful?
Other categories of iterators
Using bidirectional iterators
A more compact version
The swap function
Using random-access iterators
Iterator category summary
How the library uses these abstractions
Discussion
Example
Should type decisions be at compile time?
Generic applications
Summary
Shorter summary
Homework (due Wednesday)
Example of template iterators
Projects
Email: ark@research.att.com
Home Page: http://www.research.att.com/info/ark