|
|
The actual read operation is performed when the iterator is incremented, not when it is dereferenced. The first object is read when the iterator is constructed. Dereferencing only returns a copy of the most recently read object. https://en.cppreference.com/w/cpp/iterator/istream_iterator |
|
|
|
|
|
|
The first object is read when the iterator is constructed. |
Pressing enter does not end the stream. |
|
|
foobar barfoo ^Z foobar barfoo |