Casting by assigning to the right ...

Manfred Nowak svv1999 at hotmail.com
Tue Apr 14 07:06:16 UTC 2020


On Tuesday, 14 April 2020 at 06:15:14 UTC, Mathias LANG wrote:
[...]
>       ref S opAssign (int v) { this.data_ = v; return this; }
[...]
>     s = i;

With `opAssign' the value of `i' is assigned to `this.data_', but 
that is not the intended direction. From `this.data_' to `i' is 
intended ... and for several more types of variables.

Please see my reply to Steven:
https://forum.dlang.org/post/qdzvuduycklkhjesnyei@forum.dlang.org


More information about the Digitalmars-d mailing list