Making `object.opEquals' replaceable
Manfred Nowak via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 7 07:37:12 PDT 2015
According to the specs
http://dlang.org/operatoroverloading.html#equals
`object.opEquals' denies to call the `opEquals'-function tailored
for the class of two objects `a' an `b' if for those objects `a
is b' holds.
Although this seems resonable and reduces boiler-plate it makes
it impossible to implement a side-effect for those cases.
I do not believe, that there is good reason to disallow
side-effects in those cases. Therefore a mechanism to enable such
side-effects should be implemented.
-manfred
More information about the Digitalmars-d
mailing list