opEquals needs to return bool

Edward Diener eddielee_no_spam_here at tropicsoft.com
Fri May 16 06:39:44 PDT 2008


Steven Schveighoffer wrote:
> "Steven Schveighoffer" wrote
>> Because opEquals returns int, this breaks some generic code:
> 
> Apparently I am not the only one who thinks so :)
> 
> http://d.puremagic.com/issues/show_bug.cgi?id=1989
> 
> Can someone please dispell this myth about performance and add it to this 
> bug report?

One of the first things I mentioned on this NG when looking at D for the 
first time is to ask why opEquals returns 'int' instead of 'bool'. After 
being directed to a discussion about it and Walter's explanation of the 
reason I said that I hoped that he would come to his senses and realize 
it was just plain wrong. I have not changed my opinion one whit and I am 
glad that others also realize it is wrong. Hopefully Walter has realized 
it is wrong by this time too.

IMO, even if it were so, one does not twist programming design for a 
performance gain.



More information about the Digitalmars-d mailing list