This is the mail archive of the
mailing list for the libstdc++ project.
Re: operator== missing on std::__debug::map<>::iterator
On 11 December 2012 11:53, Pedro Larroy wrote:
> I'm not discussing if the member operator== is correct or wrong, but
> the code compiles fine in several C++ compilers and the only problem I
> found was with libstdc++ in debug mode, my point is that it should
> either compile or fail in both modes.
Why should it? Would you also claim that dereferencing a past-the-end
iterator should work in debug mode because it doesn't happen to abort
in normal mode?
Your code is not portable between different implementations. Debug
mode is a different implementation, with extra checking to catch
Your code is broken, the debug mode is not, so it seems obvious where
the change needs to be made.