inferred size for static array initialization

Namespace via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon May 2 11:57:49 PDT 2016


> A slice of a no-longer-existing temporary! Admittedly, this is 
> not an issue with your code, but a deeper issue of allowing 
> slicing of rvalues.
This works:
----
int[] as = [1, 2, 3].s;
writeln(as[2]);
----
Bug or feature? Or did I may misunderstood you?

> You can drop auto. It's just a placeholder for the storage 
> class in the case where a storage class isn't specified.
Right, I forgot, it's a bit since I wrote something in D.




More information about the Digitalmars-d-learn mailing list