Function getAndPopFront
Returns the first element and advances the range.
If range has lvalue elements, then getAndPopFront returns by reference, otherwise the returned element is copied.
Parameters
Name | Description |
---|---|
R | Input range type. |
range | Input range. |
Returns
Front range element.
See Also
getAndPopBack.
Example
int[3] array = [1, 2, 3];
auto slice = array[];
assert(getAndPopFront(slice) == 1);
assert(slice .length == 2);