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

Nick Treleaven nick at geany.org
Mon Jul 18 16:13:56 UTC 2022


On Sunday, 17 July 2022 at 17:23:18 UTC, Daniel N wrote:
> Another idea... to enumerate all possibilities.
> ```d
> scope sa = [1,2,3,4];
> ```

That is fine to stack-allocate dynamic array elements, but I 
think making that mean a fixed-length array would cause problems 
with typing. E.g. inferring `scope` would change the type of `sa` 
and fixed-length arrays are not ranges, etc.




More information about the Digitalmars-d mailing list