I thought dynamic arrays replace vectors in D, but it seems they don't have a delete function (only for associative arrays), which is more of a limitation on a vector, so I'm wondering if I have it right. If a has the following array,
uint[] a; a.length = 3; a[0] = 1; a[1] = 2; a[2] = 3;
Then the only way I found to remove, say, the second element,
a = a[0..1] ~ a[2];
But this does not seem right (but maybe only because I do not understand this yet). So, is there a vector and is there another way to remove an element from a dynamic array?
Thanks.
arrays vector d
tjm
source share