This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: rel_ops issues
- To: Joe Buck <jbuck at racerx dot synopsys dot com>
- Subject: Re: rel_ops issues
- From: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>
- Date: 01 Apr 2001 14:55:39 +0200
- Cc: libstdc++ at gcc dot gnu dot org
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <200103282124.NAA27376@racerx.synopsys.com>
[ well, apologizes if I'm jumping into a dead thread, I've just made my
return back from Oxford, and I'm sort of tired but I think we have key
issues. ]
Joe Buck <jbuck@racerx.synopsys.com> writes:
| I've seen Nathan's answer on the FAQ. I think that it is not correct,
| and that libstdc++-v3 needs more work to be a usable library. That
| is, rel_ops is not broken, __normal_iterator needs repair.
|
| I think that the fundamental quote
|
| * Short summary: the rel_ops operators cannot be made to play nice.
| * Don't use them.
|
| is wrong. The rel_ops operators *must* be made to play nice or the
| libstdc++-v3 project will have failed to deliver a conforming library.
| And they *can* be made to play nice.
Hmm I'm unclear of why you think it *must* be made to play nice.
This has been debated to death by the committee, and the consensus was
to isolate them in a separate namespace -- that was the polite way to
say they weren't brilant ideas to start with. If an user wants to
break his own code with those operators, he is free to say whatever
incantation which has the desirable effect. V3 has no business to
bring them into std.
No, Nathan's comment was not wrong -- I tend to think it should be
more definitive.
| The reason that it is correct to have a separate rel_ops namespace is
| to permit a programmer to design classes where == and != return something
| other than a bool (e.g. a lazy-evaluation expression library where the
| result is an expression object).
Not only that, it changes silently users' code and that is
unacceptable -- if a user wants to break his code, he still has the
choice to do so.
| ... It is not a license to have the world
| break when the ordinary user who is not being tricky adds a using directive.
|
| Please understand what I'm saying: NOT that the rel_ops operators should
| be promoted to std, but rather that programs that say
|
| using std::rel_ops::operator!=;
|
| and also use STL classes must work.
Programs which say that incantation deliberately choose to break --
the library has no business to fix that. Sorry.
__normal_iterator needs to be fixed. Right. But std::rel_ops isn't
the cure.
-- Gaby