array initializers

Trass3r via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 11 10:25:45 PDT 2014


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, and maybe even 
elide the copy to the heap?
The immutable arr type is even passed to 
ArrayLiteralExp::inferType but doesn't influence the literal 
type. But not sure what this is supposed to do.


More information about the Digitalmars-d mailing list