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

Dukc ajieskola at gmail.com
Sat Jul 16 16:44:16 UTC 2022


On Thursday, 14 July 2022 at 15:26:44 UTC, Dave P. wrote:
> D has no way to express a similar concept without being 
> horribly verbose with `.staticArray`.

```D
import std : sa = staticArray;
//or if you don't want to rename in the import:
alias sa = std.staticArray;
```

I admit it's annoying to do because it's so non-standard to 
rename stuff like this. I'd do this if I was using `staticArray` 
a lot, but not in the general case.


More information about the Digitalmars-d mailing list