memory management of array

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Fri Dec 19 10:24:19 PST 2008


bearophile wrote:
> dsimcha:
>> The problems with this are that it's a little bit ugly and that there's no
>> standard ArrayBuilder struct.  People have written them before, and it's very easy
>> to write your own just the way you like it, but a standard version in Phobos/Tango
>> would be nice.
> 
> It's not easy nor fast to write a good version of it.

I disagree on both counts. Haven't we discussed and settled this before? 
OP, you may want to refer to this page: http://tinyurl.com/4ufuxg and 
search for ArrayAppender.

> You can use the version from my dlibs, docs:
> http://www.fantascienza.net/leonardo/so/dlibs/builders.html
> Download code+docs here:
> http://www.fantascienza.net/leonardo/so/libs_d.zip

I believe that that implementation is unnecessarily complicated because 
it reimplements from scratch a number of strategies already present in 
the built-in array.


Andrei



More information about the Digitalmars-d mailing list