This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH] istream_iterator: unexpected read in ctor
- From: Tim Song <t dot canens dot cpp at gmail dot com>
- To: Petr Ovtchenkov <ptr at void-ptr dot info>
- Cc: "libstdc++" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 25 Aug 2017 16:02:17 -0400
- Subject: Re: [PATCH] istream_iterator: unexpected read in ctor
- Authentication-results: sourceware.org; auth=none
- References: <E1dkqHh-0008T1-MS@void-ptr.info>
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).