This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/45725] streambuf_iterator compares equal when it should not



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]