ProtoObject and comparison for equality and ordering

Jesse Phillips Jesse.K.Phillips+D at gmail.com
Thu May 16 13:34:41 UTC 2019


On Wednesday, 15 May 2019 at 22:51:11 UTC, Andrei Alexandrescu 
wrote:
> OK! I finally remembered why we went with the design "any two 
> ProtoObjects must be comparable". We should have a way to 
> document this stuff, I'd internalized it so much I'd forgotten 
> the reason.
>
> It has to do with the way D implements built-in tables. They 
> use indirect calls via TypeInfo classes that essentially 
> require the existence of equality and hashing in class objects 
> as virtual functions with fixed signatures.

Static logic is still preferable from my point of view. I wonder 
how often I use objects as keys.


More information about the Digitalmars-d mailing list