On Monday, 24 February 2014 at 12:08:31 UTC, Nordlöw wrote:
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
Wouldn't it be nice to have some kind of syntactic sugar for
this similar to what we have for static arrays?
BTW: Why isn't simply the following allowed?
int n = 3;
int[n] = void;
Is it too easy to confuse with static array syntax?
to me, it also looks like you are creating an array of ints, and
trying to void it's reference. I honestly don't like the look of
it either.
Something like "auto arr = new float[n].void" would fit better,
but still looks horrible IMO :)