Associative arrays, opCmp, opEquals and toHash in 2.066.0-b4

Jacob Carlborg via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 21 05:43:47 PDT 2014


What's up with associative arrays, opCmp, opEquals and toHash in 
2.066.0-b4. I'm trying to compile Tango with the latest beta and I'm 
getting this error:

"Error: AA key type TagIndex now requires equality rather than comparison"

Four months ago "opCmp" was added to "TagIndex" to fix some compile 
error in 2.065.0 and now it complains on "opCmp" being defined.

If I add "opEquals" it complains that I need to define toHash.

What exactly do I need to define to have a struct with two ints working 
as a key in an associative array?

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list