> As a general rule, a key should be a simple value. > Try to avoid using complex structures as keys. Or rather, if you are going to use objects as keys, think of them as each *instance* being a unique key, not "this object happens to have the same contents as that other one, so I think that they should act like the same key". As Timothy notes: you *can* do what you're asking for, but it's reasonably inefficient (from a CPU standpoint, if not a programmer-enabling one).