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

Salih Dincer salihdb at hotmail.com
Fri Jul 15 06:17:26 UTC 2022


On Friday, 15 July 2022 at 02:14:53 UTC, Mike Parker wrote:
> 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

I can hear Walter yelling for the DIPs 7 years ago: Again? No!

> This change breaks existing code, requires an awkward 
> workaround for existing uses, and has only a marginal benefit. 
> At this point, I'm opposed to it.

It was written by Walter 10 years ago 😀

SDB at 79


More information about the Digitalmars-d mailing list