Why does array loses it internal capacity on length change?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Mar 12 04:47:24 PST 2016


On Saturday, 12 March 2016 at 09:56:48 UTC, Uldis wrote:
> Why is this happening, how to avoid it?

Details here: http://dlang.org/d-array-article.html

it is so one slice can never stomp over the contents of another 
slice when you append to it.

array.assumeSafeAppend() can override it.


More information about the Digitalmars-d-learn mailing list