AA key conversion woes

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Apr 19 12:35:35 PDT 2012


On Thu, Apr 19, 2012 at 12:32:30PM -0700, H. S. Teoh wrote:
[...]
> Also, it's not hard to use UFCS to make a default toHash() function
> for classes that uses some default hashing algorithm on any class
> (same thing applies to structs) so that you don't have to define them
> per class unless you wish to override the default hash function.
[...]

I should add that this is what I intend to do in my AA implementation,
so the default toHash() functions will be provided by object.di, and
end-users don't even need to do anything to have classes and structs
"just work" as AA keys. Only if they wish to tweak the hash function, do
they need to write their own toHash.


T

-- 
It's bad luck to be superstitious. -- YHL


More information about the Digitalmars-d mailing list