|
Boost : |
Subject: Re: [boost] boost::ptr_container: seems bug in erase_if
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-12-11 04:18:07
Anton Ivanov skrev:
> Hi!
>
> In ptr_sequence_adapter.hpp we have function:
>
> template< class Pred >
> void erase_if( iterator first, iterator last, Pred pred )
> {
> range_check(first,last);
> this->base().erase( std::remove_if( first.base(), last.base(),
>
> void_ptr_delete_if<Pred,value_type>(pred) ),
> this->base().end() );
> }
>
>
> If we call this function with second parameter not equal to
> this->base().end() then function remove not only elemets for wich pred
> return true, but also all alement from last.base() to the end of
> container (this->base().end()).
Right. It should be last.base().
Thanks
-Thorsten
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk