SList.popFront

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

If there are no more references to the current element (which is being consumed), then the current element will be destroyed; this will call T's dtor, if one is defined, and will collect it's resources.

Complexity: O(1).

struct SList(T)
void
popFront
()

Examples

auto a = [1, 2, 3];
auto sl = SList!int(a);
size_t i = 0;
while (!sl.empty)
{
    assert(sl.front == a[i++]);
    sl.popFront;
}
assert(sl.empty);

Meta