shadowed rel_ops operators

Martin Sebor sebor@roguewave.com
Mon Jan 22 09:48:00 GMT 2001


Phil Edwards wrote:
> 
> On Sun, Jan 21, 2001 at 11:24:41AM -0800, Nathan Myers wrote:
> >
> > The right thing to do is to put a prominent comment in the rel_ops
> > header warning about it.
> 
> The only people reading comments in the headers are *us*.  If we're going to
> warn about this, we should do so more "proactively."  We can't use #warning;
> stl_relops.h gets included by too many things... hm.
> 
> *sigh*  We need a __builtin_warning that acts like #warning but only takes
> effect when the user actually uses it.  :-)

I don't think you want to do that. There is nothing wrong with the operators
themselves, it's the presence of ambiguous overloads that causes trouble. There
are still cases where it's perfectly safe to use the operators (e.g., by
explicitly qualifying them or using them in a scope where they do not introduce
ambiguities). We have some code that depends on those operators and wouldn't
really want to have to work around another warning.

Regards
Martin

> 
> > Probably an FAQ item would be good too.
> 
> I'll try and work something up.
> 
> Phil
> 
> --
> pedwards at disaster dot jaj dot com  |  pme at sources dot redhat dot com
> devphil at several other less interesting addresses in various dot domains
> The gods do not protect fools.  Fools are protected by more capable fools.


More information about the Libstdc++ mailing list