Boost logo

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 10:38:26


On Thu, Feb 7, 2013 at 10:46 AM, Adam Romanek <romanek.adam_at_[hidden]>wrote:

> On 02/07/2013 11:39 AM, Neil Groves wrote:
>
>> 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.
>>
>
> I know what std::erase, std::remove and the idiom are all about. The
> problem in the documentation is still there.
>
>
Well it would be... I have only just been shown where the problem is ;-)

> Check the documentation of "remove_erase" algorithm. It says:
>
> "(...) This is in contrast to the *remove* algorithm which merely
> rearranges elements. (...)"
>
>
Thanks for this report it is true that this one is incorrect. This was not
what your original email contained. You posted a snippet from the correct
example. You also explicitly stated: "I believe it's not in contrast to the
"erase" algorithm but rather the "remove" algorithm.". You didn't highlight
that remove_erase_if was inconsistent to remove_erase. From what was
presented the most likely explanation was that you had a fairly common
mis-aprehension to many others about the std::erase algorithm. I'm
delighted that this is not the case, but please don't take offence.

> On the other hand, the documentation of "remove_erase_if" algorithm says:
>
> "(...) This is in contrast to the *erase* algorithm which merely
> rearranges elements. (...)"
>
> Can you see the difference?
>
>
I can see the defect now that the relevant section has been highlighted. I
understand that you meant that the documentation for remove_erase is
incorrect rather than remove_erase_if. I shall correct this for the next
release.

> WBR,
> Adam Romanek
>
>
Thanks for the report,
Neil Groves


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk