DList.popLastOf

Removes the front or back element of the range from the list respectively.

  1. Range popFirstOf(Range range)
  2. Range popLastOf(Range range)
    struct DList(T)
    popLastOf

Parameters

range Range

Range whose element should be removed.

Return Value

Type: Range

$(D_PSYMBOL range) with its front or back element removed.

Precondition: !range.empty. range is extracted from this list.

Examples

auto list = DList!int([5, 234, 30]);
auto range = list[];

range.popFront();
range = list.popFirstOf(range);
assert(range.front == 30);
assert(range.back == 30);

assert(list.popLastOf(range).empty);
assert(list[].front == 5);
assert(list[].back == 5);

Meta