Boost logo

Boost :

Subject: Re: [boost] [Boost.Range] An issue with the documentation of 'remove_erase_if' algorithm
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2013-02-07 14:12:36


On 07.02.2013, at 16:48, Krzysztof Czainski wrote:

> 2013/2/7 Neil Groves <neil_at_[hidden]>
>
>> On Thu, Feb 7, 2013 at 10:46 AM, Adam Romanek <romanek.adam_at_[hidden]
>>> wrote:
>>
>>> Check the documentation of "remove_erase" algorithm. It says:
>>>
>>> "(...) This is in contrast to the *remove* algorithm which merely
>>> rearranges elements. (...)"
>>>
>>> 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.
>>
>
> Hi,
>
> I think you got it the other way around: remove "merely rearranges
> elements", while erase -- deletes a specified range of iterators to
> nonexistence.
>
> So from the above quotes of the docs: remove_erase_if docs seem to be wrong.

Yes. std::remove and std::remove_if are the algorithms. erase is the member function that does the real deletion.

When you fix remove_erase_if, make sure you reference remove_if, not remove.

Sebastian


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