digitalmars.D.learn - struct as dictionary key
- Lloyd Dupont (12/12) Jun 19 2011 I am creating a struct that I want to use as dictionary (associative arr...
- Lloyd Dupont (2/2) Jun 19 2011 Never mind, just found it!
I am creating a struct that I want to use as dictionary (associative array) key Initially it was a class and I overrode toHash and opCmp. I just made it a struct to be more lightweight on the system, but can't "override" toHash anymore! How can I make it a good dictionary key? Here is the struct struct PropertyId { TypeInfo declaringType; /// ditto string propertyName; /// ditto }
Jun 19 2011
Never mind, just found it! http://www.digitalmars.com/d/2.0/hash-map.html
Jun 19 2011