On Tuesday, 11 April 2017 at 20:00:48 UTC, Jethro wrote:
On Tuesday, 11 April 2017 at 03:00:29 UTC, Jon Degenhardt wrote:
On Tuesday, 11 April 2017 at 01:59:57 UTC, Jonathan M Davis
wrote:
On Tuesday, April 11, 2017 01:42:32 Jethro via
Digitalmars-d-learn wrote:
[...]
You can't reuse the mem
On Tuesday, 11 April 2017 at 03:00:29 UTC, Jon Degenhardt wrote:
On Tuesday, 11 April 2017 at 01:59:57 UTC, Jonathan M Davis
wrote:
On Tuesday, April 11, 2017 01:42:32 Jethro via
Digitalmars-d-learn wrote:
[...]
You can't reuse the memory of a dynamic array by simply
setting its length to 0.
On Tuesday, 11 April 2017 at 01:59:57 UTC, Jonathan M Davis wrote:
On Tuesday, April 11, 2017 01:42:32 Jethro via
Digitalmars-d-learn wrote:
arrays have the ability to reserve but when setting the length
to 0, it removes the reserve!! ;/
char[] buf;
buf.reserve = 1000;
buf.length = 0;
assert(b
On Tuesday, April 11, 2017 01:42:32 Jethro via Digitalmars-d-learn wrote:
> arrays have the ability to reserve but when setting the length to
> 0, it removes the reserve!! ;/
>
> char[] buf;
> buf.reserve = 1000;
> buf.length = 0;
> assert(buf.capacity == 0);
>
> But I simply want to clear the buff
arrays have the ability to reserve but when setting the length to
0, it removes the reserve!! ;/
char[] buf;
buf.reserve = 1000;
buf.length = 0;
assert(buf.capacity == 0);
But I simply want to clear the buffer, not change it's
reserve/capacity.
I've tried to hack by setting the length to 0 t