Reading about D: few questions

Mr. Anonymous mailnew4ster at gmail.com
Fri Dec 23 13:48:43 PST 2011


On 23.12.2011 19:47, Ali Çehreli wrote:
> On 12/23/2011 07:25 AM, Mr. Anonymous wrote:
>  > 2. Setting Dynamic Array Length.
>  >
>  > http://dlang.org/arrays.html#resize
>  > "A more practical approach would be to minimize the number of resizes"
>  >
>  > The solution works but is not as clean as just using array ~= c;
>  > Is there any way (language, runtime, or phobos) to declare an array that
>  > would reallocate memory by chunks, which are multiple of x?
>
> Array expansion is already more efficient than they look at first. This
> article is a good read:
>
> http://www.dsource.org/projects/dcollections/wiki/ArrayArticle

std.array.Appender is what I was talking about :)


More information about the Digitalmars-d-learn mailing list