Unified toHash() for all native types
H. S. Teoh
hsteoh at quickfur.ath.cx
Fri Mar 16 07:20:48 PDT 2012
On Fri, Mar 16, 2012 at 05:01:16PM +1100, Daniel Murphy wrote:
> How close would this put us to not needing toHash in typeinfo at all?
[...]
Is there anything besides AA's that uses TypeInfo.getHash? If not, this
will completely eliminate the need for it.
This is one of my motivations for doing this -- util.rt.hash.hashOf is
already pure, and I have a pull request to make it usable in CTFE. Once
we eliminate TypeInfo.getHash, we can finally clean up the
const/pure/etc. mess caused by the current dependency on it. That in
turn will allow most AA methods to be nothrow pure const @safe (or at
the very least nothrow pure @safe; the only AA method that can't be
nothrow is opIndex). Currently I have quite a few methods with "nothrow
pure" commented out, because of the mess in the various overrides of
TypeInfo.getHash.
T
--
To err is human; to forgive is not our policy. -- Samuel Adler
More information about the Digitalmars-d
mailing list