operator== missing on std::__debug::map<>::iterator

Pedro Larroy pedro.larroy.lists@gmail.com
Tue Dec 11 11:53:00 GMT 2012


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.

Thanks for your responses.

Pedro.

On Mon, Dec 10, 2012 at 5:47 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Mon, 10 Dec 2012, Pedro Larroy wrote:
>
>> What do you mean by doesn't exists? It exists in release mode in
>> _Rb_tree_iterator class
>>
>>      bool
>>      operator==(const _Self& __x) const
>>      { return _M_node == __x._M_node; }
>>
>> But I think it doesn't exist in the debug map iterator class, as the
>> compiler error shows.
>>
>> Shouldn't it be added to the debug map iterator class also so the code
>> compiles in both release and debug modes?  I don't think many people
>> know about the _GLIBCXX_DEBUG  macro.
>
>
> If anything, it could be removed from the non-debug mode. If you want to
> call == on the base type, then cast the arguments to the base type and just
> call ==
>
> (m_t::iterator const&)(*this) == (m_t::iterator const&)right
>
> or something like that.
>
> --
> Marc Glisse



More information about the Libstdc++ mailing list