[Issue 8008] static array literal syntax request: auto x=[1,2,3]S;

Tove tove at fransson.se
Mon Apr 30 14:50:42 PDT 2012


On Monday, 30 April 2012 at 21:18:11 UTC, bearophile_hugs at eml.cc 
wrote:
> http://d.puremagic.com/issues/show_bug.cgi?id=8008
> The [$] was shown in Issue 481  and elsewhere.

I do find the [$] syntax more elegant/intuitive...
   auto[$] a = [1, 2, 3];
... but couldn't we also solve this in library code?

auto a = [1, 2, 3].toStatic;

... as long as the compiler would optimize away the unused 
dynamic literal...



More information about the Digitalmars-d-bugs mailing list