Array literals are weird.

MoonlightSentinel moonlightsentinel at disroot.org
Sat May 1 22:48:40 UTC 2021


On Saturday, 1 May 2021 at 18:57:48 UTC, Blatnik wrote:
> ```D
> float[9] __temporary = [1, 0, 0, 0, 1, 0, 0, 0, 1];
> doSomeMatrixStuff3x3(__temporary[]);
> ```
>
> This is what you end up doing in -betterC and @nogc anyway, and 
> without them this will still save you an unnecessary allocation.

The stack propagation is unrelated to -betterC, it only depends 
on the parameter being marked as scope.


More information about the Digitalmars-d mailing list