This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

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


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


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