auto arr = [1, 2, 3] should be a static array, not a GC allocated array

Mike Parker aldacron at gmail.com
Fri Jul 15 02:14:53 UTC 2022


On Thursday, 14 July 2022 at 17:46:18 UTC, Dave P. wrote:

> Yes, I forgot to write the other half of my comment. I am also 
> annoyed by this behavior, but I would be able to work around it 
> if there was a convenient way to specify a static array of 
> inferred length. Ansi C has this, D does not.

There was a DIP for it, but the author withdrew it. Anyone is 
free to pick up where he left off:

https://github.com/dlang/DIPs/blob/master/DIPs/other/DIP1039.md


More information about the Digitalmars-d mailing list