Next : Algorithms, Previous : Containers, Top : Table of Contents
To make it possible for algorithmic templates to work directly with
input/output streams, appropriate iterator-like template classes are provided.
For example,
partial_sum_copy(istream_iterator(cin),istream_iterator (), ostream_iterator (cout, "\n"));
Reads a file containing floating point numbers from cin, and prints the partial sums onto cout.
|