ProtoObject and comparison for equality and ordering

Adam D. Ruppe destructionator at gmail.com
Wed May 15 01:25:45 UTC 2019


On Wednesday, 15 May 2019 at 01:16:56 UTC, Andrei Alexandrescu 
wrote:
> Wait, if we go with the statically-checked solution all 
> interfaces are no longer necessary. Or maybe I'm 
> misunderstanding?

interfaces are just one strategy for static checking, not a 
requirement. There'd be nothing special about these.

Realistically, the compiler wouldn't care if there's an interface 
or not. It just wants to see if the opCmp method is there and can 
be called, exactly the same as it does for structs.

The interfaces are just a way of communicating this to the user, 
documenting and formalizing the convention.


More information about the Digitalmars-d mailing list