www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - struct as dictionary key

reply "Lloyd Dupont" <ld-REMOVE galador.net> writes:
I am creating a struct that I want to use as dictionary (associative array) 
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
parent "Lloyd Dupont" <ld-REMOVE galador.net> writes:
Never mind, just found it!
Jun 19 2011