Re: opEquals when your type occurs on the right hand side of an equality test

2019-07-31 Thread Ali Çehreli via Digitalmars-d-learn
On 07/31/2019 01:03 PM, NonNull wrote: I am creating a specialized bit pattern (secretly represented as a uint) as a struct S, but want to avoid `alias this` to maintain encapsulation excepting where I overtly say. Specifically, I want to avoid making arithmetic and inequalities available for

opEquals when your type occurs on the right hand side of an equality test

2019-07-31 Thread NonNull via Digitalmars-d-learn
I am creating a specialized bit pattern (secretly represented as a uint) as a struct S, but want to avoid `alias this` to maintain encapsulation excepting where I overtly say. Specifically, I want to avoid making arithmetic and inequalities available for S. I have written opEquals to compare