popFront

Implements the range interface primitive popFront for built-in arrays. Due to the fact that nonmember functions can be called with the first argument using the dot notation, array.popFront is equivalent to popFront(array). For narrow strings, popFront automatically advances to the next code point.

  1. void popFront(inout(T)[] a)
  2. void popFront(inout(C)[] str)
    @trusted pure nothrow
    void
    popFront
    (
    C
    )
    (
    scope ref inout(C)[] str
    )
  3. import std.traits;
  4. enum bool isInputRange(R, E);

Examples

auto a = [ 1, 2, 3 ];
a.popFront();
assert(a == [ 2, 3 ]);

Meta