This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: rel_ops issues
- To: Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr (Gabriel Dos Reis)
- Subject: Re: rel_ops issues
- From: Joe Buck <jbuck at racerx dot synopsys dot com>
- Date: Sun, 1 Apr 2001 23:19:07 -0700 (PDT)
- Cc: Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr (Gabriel Dos Reis), Theodore dot Papadopoulo at sophia dot inria dot fr (Theodore Papadopoulo), libstdc++ at gcc dot gnu dot org
> | Please understand: libstdc++-v3 is not releasable until this problem is
> | solved. I and others have lots of code that requires use of the rel_ops
> | and that uses the STL; such code compiles with aCC, Sun C++, MSVC, etc,
> | etc. It's not acceptable to blame the spec when it is a simply fixed bug.
>
> I'm not arguing to release V3 as is. But I'm certainly opposed to
> deadly wrong solutions.
No one has proposed a "deadly wrong solution". I've pointed out that the
first problem (conflicting definitions for != ) can be solved by a partial
specialization of operator!= and friends for __normal_iterator, and have
given two alternatives for the second problem (some STL algorithms not
working on classes that have operator== but not operator!=).
The first alternative:
using std::rel_ops::operator!=;
is not deadly wrong if done properly. I never said to do it at file scope
(this would not be valid since the user did not request it), but rather
WITHIN the functions where it is needed. This cannot have any "deadly
wrong" effect. Nevertheless, if it makes you nervous, the alternative of
rewriting the != operators into ! and == will do the trick as well.