AA with class keys compared with identity instead of opEquals
aferust at gmail.com
Sun Sep 27 18:56:15 UTC 2020
On Sunday, 27 September 2020 at 18:39:10 UTC, Per Nordlöw wrote:
> How do I defined an AA with class as key where keys are
> compared using `is` instead of `opEquals`? Do I have to store
> the key as a `void*`?
By looking at object.d and aaA.d of druntime, I d say you don't
need to use void*. Object class has required infrastructure ready
for using classes aa keys (have not tried though). Object class
has both toHash and opEquals already implemented.
More information about the Digitalmars-d-learn