Avoid subtracting form .length

Paolo Invernizzi paolo.invernizzi at gmail.com
Mon Nov 18 10:51:24 UTC 2024


On Thursday, 14 November 2024 at 13:08:36 UTC, Manfred Nowak 
wrote:
> On Saturday, 9 November 2024 at 04:02:46 UTC, Jonathan M Davis 
> wrote:
> [...]
>>     b[0 .. a.length-1] = a[];
>>
>> You'll get a RangeError being thrown when you run the code.
> [...]
>
> Therefore a fix might be to not deminish the length:
>     b[ 0 .. a.length]= a[];
>
> -manfred

Good Lord! Manfred Nowak? Is that really you?!
Everyone, we have the history of D in its full essence, dating 
back to 2004!

:-P It's great to see you here again, even if only from time to 
time!


More information about the Digitalmars-d-learn mailing list