Static array as immutable

Radu void at null.pt
Tue Dec 12 07:44:55 UTC 2017


On Tuesday, 12 December 2017 at 07:33:47 UTC, Ivan Trombley wrote:
> Is there some way that I can make this array immutable?
>
>   static float[256] ga = void;
>   static foreach (i; 0 .. 256)
>       ga[i] = (i / 255.0f) ^^ (1 / 2.2f);

Check
https://dlang.org/phobos/std_exception.html#assumeUnique


More information about the Digitalmars-d-learn mailing list