front

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

  1. inout(T) front [@property getter]
    @property ref @safe pure nothrow @nogc
    inout(T)
    front
    (
    T
    )
    (
    return scope inout(T)[] a
    )
    if (
    !is(T[] == void[])
    )
  2. dchar front [@property getter]
  3. import std.traits;
  4. enum bool isInputRange(R, E);

Examples

int[] a = [ 1, 2, 3 ];
assert(a.front == 1);

Meta