[LC++]The behavior of istream_iterator<string> as a pointer.
Chris Vine
chris at cvine.freeserve.co.uk
Fri Dec 28 22:51:08 UTC 2001
On Thursday 27 December 2001 11:48 am, you wrote:
> Aren't the increment operator and comparison work with
> istream_iterator<string>?
[snip]
They do work, but two istream iterators using the same stream will compare as
equal if either
- neither are end-of-stream markers (ie both are still valid to read) or
- both are end-of-stream markers (ie neither are still valid to read).
In other words, they do not compare on the position within the stream. Not
all input streams will have meaningful positions (file streams will, others
generally won't).
Chris.
More information about the tuxCPProgramming
mailing list