DList.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 this was the last element in the list and there are no more references to the current list, then the list and all it's elements will be destroyed; this will call T's dtor, if one is defined, and will collect the resources.

Complexity: usually O(1), worst case O(n).

struct DList(T)
void
popFront
()

Examples

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

Meta