Example for remove with predicate is the following: int[] a = [ 1, 2, 3, 2, 3, 4, 5, 2, 5, 6 ]; assert(a[0 .. remove!("a == 2")(a).length] == [ 1, 3, 3, 4, 5, 5, 6 ]); This example is confusing because the array is named 'a' and the predicate placeholder is also named 'a'. Yes, reading the predicate blurb at the top says that 'a' is a predicate var, but if the example used 2 different names, it would at least alert the impatient reader about this assumption more clearly. I suggest: int[] r = [ 1, 2, 3, 2, 3, 4, 5, 2, 5, 6 ]; assert(r[0 .. remove!("a == 2")(r).length] == [ 1, 3, 3, 4, 5, 5, 6 ]);
https://github.com/D-Programming-Language/phobos/pull/2107
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/899155194ac1cdd208af5b3176213461a0644b21 Fix Issue 7246 - Provide a simpler example for std.algorithm.remove. https://github.com/D-Programming-Language/phobos/commit/79903eb19956fb3145ffbeb8cc34e80cd76f7d0c Merge pull request #2107 from AndrejMitrovic/Fix7246 Issue 7246 - Provide a simpler example for std.algorithm.remove.