[Bug libstdc++/89763] Making iterator's operator== breaks existing code

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Mar 18 20:06:00 GMT 2019


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89763

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
It only breaks code that is already broken, and wouldn't compile with other
compilers anyway.

The standard says that map's iterator type is implementation defined, so it's
wrong to assume it has a operator== member function. All that's guaranteed is
that x==y is a valid expression, not x.operator==(y).


More information about the Gcc-bugs mailing list