Initialize static array without explicit length

Dennis dkorpel at gmail.com
Mon Dec 3 12:19:26 UTC 2018


On Monday, 3 December 2018 at 10:00:31 UTC, Simen Kjærås wrote:
> However, it's easy to implement in a library:

It even is in phobos:
https://dlang.org/phobos/std_array.html#.staticArray

```
import std.array: staticArray;
auto a = [0, 1, 2].staticArray;
```



More information about the Digitalmars-d-learn mailing list