The Thermopylae excerpt of TDPL available online
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Thu Oct 29 14:07:14 PDT 2009
Max Samukha wrote:
> On Thu, 29 Oct 2009 13:30:35 -0500, Andrei Alexandrescu
> <SeeWebsiteForEmail at 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.
Apparently the need was felt strongly enough that a library made it into
Boost that does exactly initialization of collections (and vector in
particular), in spite of being based on a very questionable design
technique - overloading of the comma operator.
Andrei
More information about the Digitalmars-d
mailing list