Function popFrontN

Removes maximum count first elements from the input range range.

void popFrontN(R) (
  ref R range,
  size_t count
)
if (isInputRange!R);

Parameters

NameDescription
R Range type.
range Some input range.
count Number of elements to remove.

See Also

popBackN, popFrontExactly, isInputRange.

Example

int[5] a = [1, 2, 3, 4, 5];
auto slice = a[];

popFrontN(slice, 3);
assert(slice.length == 2);
assert(slice[0] == 4);
assert(slice[$ - 1] == 5);

popFrontN(slice, 20);
assert(slice.length == 0);