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-12 03:47:43


>
> > >
> > > 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.
>
> There is no such thing as std::erase. Only container member functions are
> called erase, and those *do* actually erase elements, not just rearrange
> them.
>
> The std::remove algorithm, on the other hand, just rearranges elements.
>
> Therefore, I think the OP's observation is correct.
>
>
That is a very polite way to put it! The old age has finally caught up with
me. I was completely wrong and asserting absolute nonsense earlier. I
apologize to the OP and for promoting false information. I've given myself
a pretty stiff talking to and will try not to let this happen again!

I'll fix the documentation on or before this weekend.

> Regards,
> Nate
>
>
Thanks for your patience, understanding and correction.

Regards,
Neil Groves


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