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: 03 Apr 2001 03:19:06 +0200
- Cc: bkoz at redhat dot com (Benjamin Kosnik), 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
- Organization: CMLA, ENS Cachan -- CNRS UMR 8536 (France)
- References: <200104030003.RAA27706@racerx.synopsys.com>
Joe Buck <jbuck@racerx.synopsys.com> writes:
[...]
| There are two possible fixes. One is to add
|
| using std::rel_ops::operator!=;
|
| to the body of the function, ignoring Gaby's anguished screams. :-)
Again using std::rel_ops::operator!= even at function scope is *NOT*
a fix -- it is just wrong.
Consider what should happen with:
#include <stdio.h>
namespace Mine
{
template<typename T>
bool operator==(const X<T>& a, const X<T>& b)
{
printf("%p == %p\n", &a, &b);
return true;
}
template<typename T>
bool operator!=(const X<T>& a, const X<T>& b)
{
printf("%p != %p\n", &a, &b);
return false;
}
struct Y : X<int> { };
}
-- Gaby