On Monday, 28 September 2020 at 08:26:15 UTC, Per Nordlöw wrote:
In the case where the AA-KeyType is a class (which is
represented as a pointer in D) I want the equality (opEquals)
and the hashing (toHash) of the AA to compare and hash the
pointers themselves, not the fields the classes points
On Sunday, 27 September 2020 at 19:45:07 UTC, Ferhat Kurtulmuş
wrote:
Sorry I did not understand what you meant. It would be better
if you share the answer here. I found this also
https://dlang.org/library/std/traits/key_type.html, but I dont
know if it is related.
In the case where the
On Sunday, 27 September 2020 at 19:37:10 UTC, Per Nordlöw wrote:
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*`?
I got a good answer at
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*`?
I got a good answer at
https://dlang.slack.com/archives/C1ZDHBB2S/p1601234030016700
On Sunday, 27 September 2020 at 18:56:15 UTC, Ferhat Kurtulmuş
wrote:
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
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*.
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*`?