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

Marc Glisse marc.glisse@inria.fr
Mon Dec 10 16:47:00 GMT 2012


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