[PATCH] istream_iterator: unexpected read in ctor

Tim Song t.canens.cpp@gmail.com
Fri Aug 25 20:02:00 GMT 2017


On Thu, Aug 24, 2017 at 4:55 AM, Petr Ovtchenkov <ptr@void-ptr.info> wrote:
> istream_iterator do unexpected read from stream
> when initialized by istream&.
>

This is pretty much required by the specification. See the discussion
in http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0738r0.html

And the "fix" is also wrong because it makes operator* not
thread-safe, which it is required to be (as a const member function).



More information about the Libstdc++ mailing list