[Issue 6421] Require initialization of static arrays with array literals not to allocate
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Mon May 5 04:42:51 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=6421
--- Comment #15 from bearophile_hugs at eml.cc ---
(In reply to Andrej Mitrovic from comment #5)
> I don't like them, they're too much of a special case. Re-using existing
> syntax is better IMO.
The $ syntax can't be replaced by the float[3](...) syntax. For longer arrays
counting the items is a bug-prone chore:
auto a = ubyte[47]([9,2,6,4,3,3,4,2,3,6,6,4,1,9,1,5,8,0,9,3,2,5,4,
4,8,2,2,6,0,1,9,1,1,5,3,9,9,1,6,3,7,4,5,3,0,3,4]);
Vs:
ubyte[$] a = [9,2,6,4,3,3,4,2,3,6,6,4,1,9,1,5,8,0,9,3,2,5,4,
4,8,2,2,6,0,1,9,1,1,5,3,9,9,1,6,3,7,4,5,3,0,3,4]);
--
More information about the Digitalmars-d-bugs
mailing list