On Tue, Feb 3, 2009 at 10:14 AM, Frank Benoit <keinfarb...@googlemail.com> wrote: > > arr = arr[ 0 .. lowerBound ] ~ arr[ upperBound .. $ ]; >
That's simple enough, but inefficient. Something like this: import std.c.string; // or import tango.stdc.string; T[] erase(T)(ref T[] arr, size_t idx) { if(arr.length == 0) throw new Exception("FAILCOPTER"); if(idx < arr.length - 1) memmove(&arr[idx], &arr[idx + 1], T.sizeof * (arr.length - idx - 1)); arr.length = arr.length - 1; return arr; }