[Issue 13619] std.container.array capacity not updated when length increases

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Oct 21 01:33:02 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=13619

safety0ff.bugz <safety0ff.bugz at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |safety0ff.bugz at gmail.com

--- Comment #2 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
I think the bug you reported is not valid.
However, there is a bug when using length to shorten the array:

import std.container;

void main() {
  Array!int a; // empty Array
  a.length = 10; // a contains 10 default ints
  a.length = 9; // Remove one, should have capacity > 0
  assert(a.capacity > 0);
}

--


More information about the Digitalmars-d-bugs mailing list