Why does Object.opEquals return int?

Bill Baxter dnewsgroup at billbaxter.com
Wed Nov 8 17:39:27 PST 2006


Object.opEquals returns int for some reason.  That means I can't do 
something like:

      bool func() {
        ...
        return objA == objB;
      }

(Because int can't be converted to bool automatically). Instead I have 
to do something like

        return (objA == objB)!=0;

Which is just looks silly.

Is there any good reason for opEquals to return an int?  opCmp has to, I 
understand, but opEquals has no business returning int.  Is this a 
holdover from the days before bool?

--bb



More information about the Digitalmars-d mailing list