Static array as immutable

Ivan Trombley itrombley at dot-borg.org
Tue Dec 12 08:09:48 UTC 2017


On Tuesday, 12 December 2017 at 07:44:55 UTC, Radu wrote:
> 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

Thanks.


More information about the Digitalmars-d-learn mailing list