Removing an object from a range

Andrej Mitrovic andrej.mitrovich at gmail.com
Mon Dec 13 10:22:44 PST 2010


On 12/13/10, Steven Schveighoffer <schveiguy at yahoo.com> wrote:
> does this work?
>

Yes, ty. But I think there's a typo in std.algorithm.remove:

Range remove(alias pred, SwapStrategy s = SwapStrategy.stable,
Range)(Range range);
    Reduces the length of the bidirectional range range by only
keeping elements that satisfy pred.

This should probably be "by only keeping elements that *do not*
satisfy pred.", right?

Here's a short example where I just shorten the length of an array:
http://pastebin.com/gL6EYJzd


More information about the Digitalmars-d-learn mailing list