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

Ola Fosheim Grøstad ola.fosheim.grostad at gmail.com
Fri Jul 15 06:31:58 UTC 2022


On Friday, 15 July 2022 at 06:17:26 UTC, Salih Dincer wrote:
> 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!
>

But now you can just point out that C++ does it...


More information about the Digitalmars-d mailing list