AA with class keys compared with identity instead of opEquals

Per Nordlöw per.nordlow at gmail.com
Mon Sep 28 09:28:04 UTC 2020


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 to.

For D-classes this is the default. For extern(C++) classes it's 
not defined. That's why I added the struct wrapper on top of an 
extern(C++) class.


More information about the Digitalmars-d-learn mailing list