24
Iterators library
[iterators]
24.6
Stream iterators
[stream.iterators]
24.6.1
General
[stream.iterators.general]
1
#
To make it possible for algorithmic templates to work directly with input/output streams, appropriate iterator-like class templates are provided
.
[
Example
1
:
partial_sum
(
istream_iterator
<
double
,
char
>
(
cin
)
, istream_iterator
<
double
,
char
>
(
)
, ostream_iterator
<
double
,
char
>
(
cout,
"\n"
)
)
;
reads a file containing floating-point numbers from
cin
, and prints the partial sums onto
cout
.
—
end example
]