popBack

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

  1. void popBack(inout(T)[] a)
  2. void popBack(inout(T)[] a)
    @safe pure
    void
    popBack
    (
    T
    )
    (
    scope ref inout(T)[] a
    )
  3. import std.traits;
  4. enum bool isInputRange(R, E);

Examples

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

Meta