How can I do that? I though something like this:

auto arr = [1, 2, 3, 4];
arr = arr[0 .. 0];
arr ~= 6; // does this cause reallocation?

assumeSafeAppend() wouldn't work in this case because I don't know the number of items that is going to be added to the array. I thought into setting the length property to 0. Does this free the memory block of the array? if it did reuse the existing memory block in further appends, would do what I want

Reply via email to