Initialize static array without explicit length

Simen Kjærås simen.kjaras at gmail.com
Mon Dec 3 12:22:32 UTC 2018


On Monday, 3 December 2018 at 12:19:26 UTC, Dennis wrote:
> 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;
> ```

The more you know. Thankies! :)

--
   Simen


More information about the Digitalmars-d-learn mailing list