|
Boost : |
Subject: Re: [boost] [Boost.Range] An issue with the documentation of 'remove_erase_if' algorithm
From: Neil Groves (neil_at_[hidden])
Date: 2013-02-07 05:39:35
On Thu, Feb 7, 2013 at 7:15 AM, Adam Romanek <romanek.adam_at_[hidden]> wrote:
> Hi,
>
> I think there's an issue with the documentation of 'remove_erase_if'
> algorithm from Boost.Range library.
>
> It says:
>
> "remove_erase_if removes the elements x that satisfy pred(x) from the
> container. This is in contrast to the erase algorithm which merely
> rearranges elements."
>
> I believe it's not in contrast to the "erase" algorithm but rather the
> "remove" algorithm.
>
>
On this particular ocassion the documentation is correct. The std::erase
algorithm does not remove elements. Hence the erase - remove idiom is
frequently useful:
http://en.wikipedia.org/wiki/Erase-remove_idiom
I have then made this idiom available and directly supported in Boost.Range.
> WBR,
> Adam Romanek
>
>
Thanks,
Neil Groves
> ______________________________**_________________
> Unsubscribe & other changes: http://lists.boost.org/**
> mailman/listinfo.cgi/boost<http://lists.boost.org/mailman/listinfo.cgi/boost>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk