Discussion Thread: DIP 1042--ProtoObject--Community Review Round 1

Dom DiSc dominikus at scherkl.de
Fri Jan 14 20:58:58 UTC 2022


On Friday, 14 January 2022 at 19:22:59 UTC, H. S. Teoh wrote:
> This is a nonsensical argument.  So the default order of every 
> data type should be its address?  You don't need .opCmp for 
> that, just cast the pointer and compare its value.
Just FYI: at the moment, yes, the default implementation of opCmp 
does just that: comparing the address, however sensible or 
nonsensical that may be. Only if you want something different, 
you need to implement opCmp yourself.

But ok, maybe you convinced me that not every class needs an 
opCmp.
Maybe the whole concept of classes is not so very useful anymore 
if you have structs, alias this and 
UFCS-(pseudo-)member-functions.


More information about the Digitalmars-d mailing list