Logo

Programming-Idioms

History of Idiom 135 > diff from v12 to v13

Edit summary for version 13 by programming-idioms.org:
[D] Doesn't seem to work

Version 12

2018-01-17, 16:53:49

Version 13

2018-03-27, 21:51:38

Idiom #135 Remove item from list, by its value

Remove at most 1 item from list items, having value x.
This will alter the original list or return a new list, depending on which is more idiomatic. If there are several occurrences of x in items, remove only one of them.

Idiom #135 Remove item from list, by its value

Remove at most 1 item from list items, having value x.
This will alter the original list or return a new list, depending on which is more idiomatic. If there are several occurrences of x in items, remove only one of them.

Imports
import std.algorithm.mutation;
Imports
import std.algorithm.mutation;
Code
items = items.remove(x);
Code
items = items.remove(x);
Comments bubble
Hm, this doesn't seem to work ... or to follow the doc
Doc URL
https://dlang.org/phobos/std_algorithm_mutation.html#.remove.2
Doc URL
https://dlang.org/phobos/std_algorithm_mutation.html#.remove.2