Array.front

Provide access to the first element in the array. The user must check that the array isn't empty, prior to calling this function.

struct Array(T)
ref
front
(
this _
)
()

Return Value

Type: auto ref

a reference to the first element.

Complexity: O(1).

Examples

auto a = Array!int(1, 2, 3);
assert(a.front == 1);
a.front = 0;
assert(a.front == 0);

Meta