mirror of
https://github.com/dlang/phobos.git
synced 2025-05-05 09:30:49 +03:00
Merge pull request #450 from CyberShadow/std-algorithm-remove-doc
std.algorithm: Fix the documentation of remove with pred
This commit is contained in:
commit
e6b74d33f6
1 changed files with 7 additions and 8 deletions
|
@ -6078,18 +6078,17 @@ unittest
|
|||
}
|
||||
|
||||
/**
|
||||
Reduces the length of the bidirectional range $(D range) by only
|
||||
keeping elements that satisfy $(D pred). If $(D s =
|
||||
SwapStrategy.unstable), elements are moved from the right end of the
|
||||
range over the elements to eliminate. If $(D s = SwapStrategy.stable)
|
||||
(the default), elements are moved progressively to front such that
|
||||
their relative order is preserved. Returns the tail portion of the
|
||||
range that was moved.
|
||||
Reduces the length of the bidirectional range $(D range) by removing
|
||||
elements that satisfy $(D pred). If $(D s = SwapStrategy.unstable),
|
||||
elements are moved from the right end of the range over the elements
|
||||
to eliminate. If $(D s = SwapStrategy.stable) (the default),
|
||||
elements are moved progressively to front such that their relative
|
||||
order is preserved. Returns the filtered range.
|
||||
|
||||
Example:
|
||||
----
|
||||
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 ]);
|
||||
assert(remove!("a == 2")(a) == [ 1, 3, 3, 4, 5, 5, 6 ]);
|
||||
----
|
||||
*/
|
||||
Range remove(alias pred, SwapStrategy s = SwapStrategy.stable, Range)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue