c++/3628: "using std::rel_ops" blows up std::vector
Gabriel Dos Reis
Gabriel.Dos-Reis@cmla.ens-cachan.fr
Tue Jul 10 04:26:00 GMT 2001
The following reply was made to PR c++/3628; it has been noted by GNATS.
From: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>
To: Richard.Kreckel@ginac.de
Cc: Gabriel Dos Reis <Gabriel.Dos-Reis@cmla.ens-cachan.fr>,
gcc-gnats@gcc.gnu.org, Joe Buck <jbuck@racerx.synopsys.com>
Subject: Re: c++/3628: "using std::rel_ops" blows up std::vector
Date: 10 Jul 2001 13:16:47 +0200
"Richard B. Kreckel" <kreckel@ginac.de> writes:
| On 9 Jul 2001, Gabriel Dos Reis wrote:
| [...]
| > The fix is to leave std::rel_ops where it is and not to touch it.
| > We need to tell users to forget about std::rel_ops.
|
| What's the reason?
The reason is that operators defined in std::rel_ops are toooo greedy
and do not interact well with the rest of the language. The mere fact
that they were sequestred in a separate namespace should be an
indication that they were a mistake.
| Is it impossible to fix this?
Fix what exactly?
| If so, is there a workaround?
Don't use std::rel_ops.
| After all, a compiler conforming to section 20.2
| [lib.utility] should provide std::rel_ops.
Certainly, certainly. But not just because it is there means you're
obliged to use it -- and in this particular case, it is well known
that they were a mistake.
-- Gaby
More information about the Gcc-prs
mailing list