1 /**
2     Removes elements from a range
3 */
4 module ddash.algorithm.remove;
5 
6 ///
7 unittest {
8     auto arr = [1, 2, 3, 4];
9     arr.remove!(a => a % 2 == 0);
10     assert(arr.equal([1, 3]));
11 }
12 
13 import ddash.common;
14 
15 /**
16     Modified the range by removing elements by predicate
17 
18     Params:
19         pred = unary predicate that returns true if you want an element removed
20         range = the range to remove element from
21 
22     Since:
23         0.0.1
24 */
25 void remove(alias pred, Range)(ref Range range) if (from!"std.range".isInputRange!Range) {
26     import std.algorithm: stdRemove = remove;
27     range = range.stdRemove!pred;
28 }