"+=" (overloads) with custom array slices on both lhs, and rhs ??

james.p.leblanc james.p.leblanc at gmail.com
Sun Sep 5 21:15:00 UTC 2021


On Sunday, 5 September 2021 at 21:06:49 UTC, Ali Çehreli wrote:
> On 9/5/21 12:43 PM, james.p.leblanc wrote:
>

>
>   m[4 .. $] -= 100;
>   writeln(m);
>
>   m[] *= 2;
>   writeln(m);
> }
>
> Ali

Ali,

Thanks for your example code ... I have much to learn from this
and will need to study it tomorrow when I am fresh.

I hope that I will see how to extend this so that it can do
slices on both the left side and right side ... for example:

```d

m[ 4 .. 8 ] += q[ 7 .. 11 ];

```

Best Regards,
James



More information about the Digitalmars-d-learn mailing list