This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/46906] istreambuf_iterator is late?
- From: "marc.glisse at normalesup dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 05 Sep 2011 15:05:56 +0000
- Subject: [Bug libstdc++/46906] istreambuf_iterator is late?
- Auto-submitted: auto-generated
- References: <bug-46906-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46906
--- Comment #11 from Marc Glisse <marc.glisse at normalesup dot org> 2011-09-05 15:05:56 UTC ---
(In reply to comment #10)
> > When I read that operator* returns sgetc(), I understand that as
> > assert(*i==buf.sgetc()).
> But as explained below this requires that no further external source modifies
> the stream (buffer) at the same time. It is unspecified whether an
> implementation caches the read value or not.
I am sorry but I still can't see what allows the implementation to cache the
value in the presence of external changes to the streambuf.
> The "(void)*a, *a" requirements ensures that you can invoke operator* several
> times without a value change of the result. This holds for both implementations
> if no external changes happen to the stream buffer.
But here there is an external change, so it doesn't apply.
> You could request an LWG issue for this to clarify the intent
Nah, since it looks clear to you that both behaviors are valid, unless someone
else complains, I'll leave it alone (and I guess I'll close the bug as
invalid).