This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: operator== missing on std::__debug::map<>::iterator
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Pedro Larroy <pedro dot larroy dot lists at gmail dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 10 Dec 2012 14:17:22 +0100
- Subject: Re: operator== missing on std::__debug::map<>::iterator
- References: <CAC_CU1hQxVoOsUus5q_sOP8ouVde6QYajSxs7CD85BmGoCxFRg@mail.gmail.com>
Hi,
On 12/10/2012 02:00 PM, Pedro Larroy wrote:
Hi
I'm trying to compile with -D_GLIBCXX_DEBUG and I get an error which
doesn't happen without the previous macro
There's an implementation of iterator inheriting privately from
std::__debug::map<......>::iterator and calling for operator==
operator== in the 'std::__debug::map<......>::iterator
I get the following error:
error: 'operator==' is not a member of 'std::__debug::map<......>::iterator
Is operator== missing intentionally from the iterator class?
Please post a self-contained testcase exhibiting the problem. As a
general principle, any kind of code compiling in normal mode is supposed
to compile in debug-mode and the debug-mode iterator details are pretty
old, thus I would be surprised if nobody noticed before such a
macroscopic issue as operator== missing (and most likely we would see
dozens of fails when running make check-debug) . Indeed something like
this compiles fine in all the active branches with -D_GLIBCXX_DEBUG:
#include <map>
int main()
{
std::map<int, int> m;
auto it1 = m.begin();
auto it2 = m.end();
if (it1 == it2)
;
}
Note, just in case isn't obvious, that operator== is a *free* function,
not a member function of the iterator class (both for normal mode and
debug-mode iterator)
Paolo.