From: "W" <wa...@so...> Sunday, September 22, 2002 11:49 AM:
> Just noticed this in remove_copy_if code [ <algorithm> (rev. 1.8) ]
>
> while (_First != _Last)
> {
> if (_Pred(*_First))
> *_Result++ = *_First;
> ++_First;
> }
> return _Result;
>
>
> Shouldn't that be if (! _Pred(*_First)) ?
>
> "remove_copy_if() copies elements from a source range to a destination
> range, except that satisfying a predicate are not copied" ...
http://www.dinkumware.com/htm_cpl/algorith.html#remove_copy_if concurs with
you, as does logic. Make the appropriate change.
(Of course, the above algorithm ought to be in the Standard, only spelled
"copy_if" -- I don't know what they were thinking, really...)
- Shane/[eloi]
|