On 2013-02-02 17:36, Namespace wrote:
     ubyte[] arr = new ubyte[4];
     arr ~= 4; // desirable: [4, 0, 0, 0];

Why not arr[0] = 4? What is so special about having 4 elements?

As I looked at arr.length and arr.capacity for the first time I was schocked: I
want only space for 4 items, but I got space for 15.

I think you are out of luck with built-in dynamic arrays.
It seems that even for an array of length 1 it gives a minimum of 15 bytes
storage, so you can fit 15 bytes, 7 shorts, 3 ints, 1 long.
I'm not sure why is it 15, given alignment an all...

Reply via email to