Function popFrontExactly
Removes exactly count first elements from the input range range.
void popFrontExactly(R)
(
ref R range,
size_t count
)
if (isInputRange!R && (hasLength!R || isInfinite!R));
R must have length or be infinite.
Parameters
| Name | Description |
|---|---|
| R | Range type. |
| range | Some input range. |
| count | Number of elements to remove. |
See Also
popBackExactly, popFrontN, isInputRange, hasLength, isInfinite.
Precondition
If R has length, it must be less than or equal to count.
Example
int[5] a = [1, 2, 3, 4, 5];
auto slice = a[];
popFrontExactly(slice, 3);
assert(slice .length == 2);
assert(slice[0] == 4);
assert(slice[$ - 1] == 5);
popFrontExactly(slice, 2);
assert(slice .length == 0);