opHash??
H. S. Teoh
hsteoh at quickfur.ath.cx
Tue Apr 10 18:44:40 PDT 2012
TDPL, p.117, last para:
... For a user-defined type to be used as a key in an
associative array, it must define two special methods, opHash
and opCmp.
Really? I thought the convention was toHash (TDPL, p.205). So, which is
it? Which *should* it be?
To me, it seems utterly arbitrary that classes should use toHash whereas
non-class user-defined types should use opHash. Shouldn't we make it
consistent across the board?
T
--
It is of the new things that men tire --- of fashions and proposals and
improvements and change. It is the old things that startle and
intoxicate. It is the old things that are young. -- G.K. Chesterton
More information about the Digitalmars-d
mailing list