getAndPopFront

Returns the first element and advances the range.

If range has lvalue elements, then $(D_PSYMBOL getAndPopFront) returns by reference, otherwise the returned element is copied.

getAndPopFront
(
R
)
(
ref R range
)

Parameters

R

Input range type.

range R

Input range.

Return Value

Type: ElementType!R

Front range element.

Examples

int[3] array = [1, 2, 3];
auto slice = array[];

assert(getAndPopFront(slice) == 1);
assert(slice.length == 2);

See Also

$(D_PSYMBOL getAndPopBack).

Meta