On Thu, 29 Oct 2009 21:59:13 +0300, Max Samukha <spam...@d-coding.com> wrote:

On Thu, 29 Oct 2009 13:30:35 -0500, Andrei Alexandrescu
<seewebsiteforem...@erdani.org> wrote:

It's me as well. The decision didn't go without a fight (I had your
viewpoint and Walter didn't). He convinced me with two arguments. One is
that 90% of the time you actually want T[], not T[n].

The argument may be flawed because, out of those 90% of arrays, only
small part may be initialized from array literals. Many (most?) are
created with new or appended. I suspect dynamic arrays created from
literals are as rare as static arrays in real world code. Probably,
I'll investigate how exactly rare.

I agree. It also involves a hidden allocation and there is no way around it:

int[] t = [0, 1, 2] ~ [3, 4, 5]; // how many allocations here take place? 1? No, 3!

Reply via email to