The OpenD Programming Language

popFrontExactly

pragma(inline, true)
void
popFrontExactly
(
size_t dim = 0
T
)
(
scope ref inout(T)[] ar
,
size_t n
)
if (
!dim &&
!is(Unqual!T[] == void[])
)

Examples

auto ar = [3, 4, 5];
ar.popFrontExactly(2);
assert(ar == [5]);
ar.popFrontExactly!0(1);  // Slice-like API
assert(ar == []);

Meta