This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/2405: "using std::rel_ops" blows up std::vector
- To: gcc-gnats at gcc dot gnu dot org
- Subject: Re: c++/2405: "using std::rel_ops" blows up std::vector
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Tue, 27 Mar 2001 16:05:25 -0800 (PST)
- Cc: gcc-bugs at gcc dot gnu dot org
OK, I think that I know how to fix this one. Note that c++/847 is
related.
The issue is that if we have
using std::rel_ops;
then neither of operator!=(const _Tp&, const _Tp&)
nor operator!=(const std::__normal_iterator<_IteratorL, _C>&,
const std::__normal_iterator<_IteratorR, _C>&)
is considered better. But what if we break the tie?
I tried adding a definition for
operator!=(const std::__normal_iterator<_Iterator, _C>&,
const std::__normal_iterator<_Iterator, _C>&)
The difference is that both arguments must be equal, and both
must be a __normal_iterator. We no longer have a tie, and the
test case works (it's not a tie because it is a strictly better
match).
The new definitions should be added to stl_iterator.h, not only for
operator!= but also for the other operators.