Array.removeFront

Remove n of elements from the start.

struct Array(T, size_t chunkSize = 32)
uint
removeFront
(
const(uint) n
)

Return Value

Type: uint

number of removed elements.

Examples

Array!int arr;
scope(exit) arr.free();

arr.insertBack([1,2,3]);
assert(arr.removeFront(3) == 3);

arr.insertBack([1,2,3,4]);
assert(arr.removeFront(2) == 2);
assert(arr.data == [3,4]);

assert(arr.removeFront(3) == 2);
assert(arr.length == 0);

Meta