On Sunday, 3 February 2019 at 16:33:48 UTC, Emil wrote:
I tried this on a whim and it appears to work:

auto static_array(T, size_t data_size)()
{
    T[data_size] data;
    return data;
}

This is actually already in the standard library:

https://dlang.org/phobos/std_array.html#staticArray

Reply via email to