opCmp and opEquals woes

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 05:06:05 PDT 2014


On 25/07/14 12:39, Jonathan M Davis wrote:

> But regardless of whether the efficiency cost is large, you're talking
> about incurring it just to fix the code of folks who couldn't be
> bothered to make sure that opEquals and lhs.opCmp(rhs) == 0 were
> equivalent. You'd be punishing correct code (however slight that
> punishment may be) in order to fix the code of folks who didn't even
> properly test basic functionality. I see no reason to care about trying
> to help out folks who can't even be bothered to test opEquals and opCmp,
> especially when that help isn't free.

By Walter and Andrei's definition opCmp is not to be used for 
equivalent, therefor opCmp does never need to be equal to 0.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list