This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/45725] streambuf_iterator compares equal when it should not
- From: "paolo dot carlini at oracle dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 19 Sep 2010 09:18:06 -0000
- Subject: [Bug libstdc++/45725] streambuf_iterator compares equal when it should not
- References: <bug-45725-19655@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from paolo dot carlini at oracle dot com 2010-09-19 09:18 -------
(In reply to comment #0)
> bool std::operator==( std::istreambuf_iterator, std::istreambuf_iterator )
> returns TRUE if both iterators are EOF or both are not. That means two
> iterators at different places in the streambuf -- which, when dereferenced
> produce different characters -- nevertheless compare as equal. This is
> inconsistent with how other iterators work, and inconsistent with the pointer
> model of iterators.
Maybe, but this is how, exactly those iterators are specified to behave, see
24.5.3.5 and 24.5.3.6 in the ISO C++ Standard which we are implementing. Also
note that the current draft of the next ISO C++ Standard doesn't change that.
Thus, as implementors, there is nothing we can do here, I'm sorry.
--
paolo dot carlini at oracle dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45725