mirror of
https://github.com/dlang/phobos.git
synced 2025-05-04 17:11:26 +03:00
12 lines
321 B
Text
12 lines
321 B
Text
`std.container.dlist` supports `linearRemoveElement`
|
|
|
|
`linearRemoveElement` removes the first occurence of an element from the dlist
|
|
|
|
-----
|
|
import std.container : Dlist;
|
|
import std.algorithm.comparison : equal;
|
|
|
|
auto a = DList!int(-1, 1, 2, 1, 3, 4);
|
|
a.linearRemoveElement(1);
|
|
assert(equal(a[], [-1, 2, 1, 3, 4]));
|
|
-----
|