SList.front

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

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

Return Value

Type: auto ref

a reference to the first element.

Complexity: O(1).

Examples

auto sl = SList!int(1, 2, 3);
assert(sl.front == 1);
sl.front = 0;
assert(sl.front == 0);

Meta