On 26 July 2014 06:38, Walter Bright via Digitalmars-d <digitalmars-d@puremagic.com> wrote:
On 7/25/2014 4:10 AM, Regan Heath wrote:You've agreed with my point, then, that autogenerating opEquals as memberwise equality (not opCmp==0) if one is not supplied will be correct unless the user code is already broken.
Sure, Andrei makes a valid point .. for a minority of cases. The majority case
will be that opEquals and opCmp==0 will agree. In those minority cases where
they are intended to disagree the user will have intentionally defined both, to
be different. I cannot think of any case where a user will intend for these to
be different, then not define both to ensure it.
No, because there's no obvious reason to define opEquals if you do define opCmp, and the opEq