[Issue 18675] std.experimental.checkedint.Checked has opEquals but no toHash
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 4 14:34:14 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18675
--- Comment #2 from Jack Stouffer <jack at jackstouffer.com> ---
(In reply to vladvitan from comment #1)
> I want to work on this. Could you please give me a starting point for this?
> Should I use the toHash() functionality from druntime?
Yes, or you can use typeid(var).getHash(&var).
You'll have to put this inside of a trusted lambda in order for it to be @safe.
The main thing you need to make sure is that it follows the logic of opEquals,
i.e. two things have the same hash according to opEquals' logic.
--
More information about the Digitalmars-d-bugs
mailing list