array initializers

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 10:34:15 PDT 2014


Trass3r:

> If you have
> immutable int[] arr = [0,1,0,3];
>
> Couldn't the type of the literal be inferred as immutable?
> Then you could put the data into read-only memory,

Did you mean this?

immutable int[4] arr = [0, 1, 0, 3];

Bye,
bearophile


More information about the Digitalmars-d mailing list