DList.remove

Remove the current element from the list. If there are no more references to the current element, then it will be destroyed.

struct DList(T)
void
remove
()

Examples

import std.algorithm.comparison : equal;

auto dl = DList!int(1, 2, 3);
auto dl2 = dl;

assert(equal(dl, [1, 2, 3]));
dl.popFront;
dl.remove();
assert(equal(dl, [3]));
assert(equal(dl2, [1, 3]));
dl.popPrev;
assert(equal(dl, [1, 3]));

Meta