Operator "+=" overloading for class?

Adam D. Ruppe destructionator at gmail.com
Sun Dec 17 07:05:12 UTC 2023


On Sunday, 17 December 2023 at 04:13:20 UTC, Ki Rill wrote:
> auto opOpAssign(string op)(in ElementType rhs)
> {
>     mixin("return this" ~ op ~ "rhs;");
> }
> ```

check what `op` is. pretty sure it is "+" not "+=" so your 
element isnt' saved anywhere. also a bit iffy there isn't a 
member here to work on


More information about the Digitalmars-d-learn mailing list