WAT: opCmp and opEquals woes

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


On 25/07/14 08:50, Walter Bright wrote:

> Yes, that's why it's hard to see that it would break existing code,
> unless that existing code had a bug in it that was worked around in some
> peculiar way.

If the type was only used as an AA key and never checked for equivalent 
then it worked correctly when opCmp was used for AA keys.

Also, adding an opEqual to call opCmp == 0 will make it work for 
equivalent as well, even though it's never used. And it will fix the 
breaking change with AA keys.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list