Bogus name lookup by overloaded operators
Martin v. Loewis
martin@loewis.home.cs.tu-berlin.de
Mon Mar 13 01:11:00 GMT 2000
> Thus I think the lookup rules should be adjusted in such a way that unary
> and binary operators that PURELY OCCASIONALLY but UNAVOIDABLY share the same
> operation sign, are treated as different and mutually independent names.
Please understand that the g++ developers feel more bound to the ISO
standard than to your opinion. So in order to have g++ changed, the
standard has to change first. As we've discussed before, discussing
such a change is more appropriate in the C++ fora than on egcs-bugs.
In case you are still looking for a work-around: You can write your
code as
struct Derived:DereferencingBase, MultiplyingBase{
result operator*(){
return DereferencingBase::operator*();
}
result operator*(other_operand o){
return MultiplyingBase::operator*(o);
}
};
Regards,
Martin
More information about the Gcc-bugs
mailing list