This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bogus name lookup by overloaded operators


> 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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]