Function popFront

popFront and popBack advance the array and remove one element from its back, respectively.

void popFront(T) (
  scope ref inout(T)[] array
);

popFront and popBack don't alter the array storage, they only narrow the view into the array.

Parameters

NameDescription
T Element type of array.
array Built-in array.

Precondition

array.length > 0.

Example

wstring array = "Der finstere Ozean der Metaphysik. Nietzsche";

array.popFront();
assert(array.length == 43);
assert(array.front == 'e');

array.popBack();
assert(array.length == 42);
assert(array.back == 'h');