How would you fill up a vector with the numbers zero
through one hundred using std::copy()? The only iterator
operation missing from builtin integer types is an
operator*() that returns the current value of the integer.
The counting iterator adaptor adds this crucial piece of
functionality to whatever type it wraps. One can use the
counting iterator adaptor not only with integer types, but with
any incrementable type.

counting_iterator adapts an object by adding an operator* that
returns the current value of the object. All other iterator operations
are forwarded to the adapted object.

Specializations of counting_iterator model Readable Lvalue
Iterator. In addition, they model the concepts corresponding to the
iterator tags to which their iterator_category is convertible.
Also, if CategoryOrTraversal is not use_default then
counting_iterator models the concept corresponding to the iterator
tag CategoryOrTraversal. Otherwise, if
numeric_limits<Incrementable>::is_specialized, then
counting_iterator models Random Access Traversal Iterator.
Otherwise, counting_iterator models the same iterator traversal
concepts modeled by Incrementable.

counting_iterator<X,C1,D1> is interoperable with
counting_iterator<Y,C2,D2> if and only if X is
interoperable with Y.

This example fills an array with numbers and a second array with
pointers into the first array, using counting_iterator for both
tasks. Finally indirect_iterator is used to print out the numbers
into the first array via indirection through the second array.