This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Bogus name lookup by overloaded operators
- To: gcc-bugs at gcc dot gnu dot org
- Subject: Re: Bogus name lookup by overloaded operators
- From: "Leonid A. Broukhis" <leob at mailcom dot com>
- Date: Fri, 10 Mar 2000 16:13:05 -0800
For context, see http://gcc.gnu.org/ml/gcc-bugs/2000-03/msg00440.html
Then, if gcc's implementation of the rules is correct, out of the following:
class Dereferenceable {
public:
void operator* () const;
};
class Multipliable {
public:
void operator* (Multipliable &) const;
};
class Addable {
public:
void operator+(Addable &) const;
};
class DerefMultipliable : public Dereferenceable, public Multipliable { };
class DerefAddable : public Dereferenceable, public Addable { };
DerefAddable is perfectly fine, but DerefMultipliable is useless
_just because_ the symbol for multiplication (a binary op) is the same
as for dereferencing (a unary op). Is it me, or somebody in the ANSI
committee was not feeling well, to put it mildly?
And speaking of the original example: Why care about ambiguity if none of
the candidates comprising the ambiguity is a match?
Leo