struct as dictionary key

Lloyd Dupont ld-REMOVE at galador.net
Sun Jun 19 07:06:28 PDT 2011


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
} 



More information about the Digitalmars-d-learn mailing list