object.opEquals return type

JMNorris nospam at nospam.com
Tue Feb 26 03:38:17 PST 2008


Edward Diener <eddielee_no_spam_here at tropicsoft.com> wrote in
news:fps7es$1uh4$1 at digitalmars.com: 

> If one were to carry the efficiency argument further, than the other 
> possible logical conclusion is that a 'bool' should be an 'int' ( 
> constrained to be of value either 0 or 1 ) rather than a 'byte'. But
> to justify a poor design decision based purely on efficiency is
> exceedingly silly.

If I understood the discusion in the previous link correctly, it was
(at least mostly) the constraint to 0 or 1, not the smaller size of the
return, that was less efficient.  Returning an int may still be silly (the 
mere existance of this thread suggests that it is at least confusing), but 
making a bool the size of an int won't solve the efficiency concern.

-- 
JMNorris



More information about the Digitalmars-d mailing list