Static Array Idiom not working anymore.

Guillaume Piolat first.last at gmail.com
Thu Jun 14 11:07:49 UTC 2018


On Tuesday, 12 June 2018 at 15:35:42 UTC, Steven Schveighoffer 
wrote:
>
> No, that's not what I mean. What I mean is:
>
> int[] arr = [1,2,3].s;
> int[] arr2 = [4,5,6].s;
>
> Legally, the compiler is allowed to reuse the stack memory 
> allocated for arr for arr2. The lifetime of the arr data is 
> over.
>
> -Steve

https://github.com/p0nce/d-idioms/issues/150

Especially if the stdlib has a way to do this now.


More information about the Digitalmars-d-learn mailing list