Boost logo

Boost Users :

From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2008-05-07 04:10:12


Sergey Sadovnikov skrev:
> Hello, Thorsten.
>
> Monday, May 5, 2008 at 10:30:21 PM you wrote:
>
> TO> Sergey Sadovnikov skrev:
>
> TO> The code in trunk changed after we could patch the release branch. Could
> TO> you please check that code to see if it is still surprising to you?
> Trunk code is still surprising me. :) If boost::ptr_sequence_adapter::erase_if has to guarantee
> standard std::list::remove_if behavior (for ptr_list container, of
> course) it should be overridden in the ptr_list
> class. For example, in this way:
>
> template
> <
> class T,
> class CloneAllocator = heap_clone_allocator,
> class Allocator = std::allocator<void*>
> >
> class ptr_list /* ... */
> {
> public:
> //...
> template< class Pred >
> void erase_if( Pred pred )
> {
> this->base().remove_if(void_ptr_delete_if<Pred,value_type>(pred));
> }
> //...
> };
>
> This code corresponds all my expectations. :)

I think we need to classify this as a bug for ptr_list. I'll add the
above to that class.

Thanks

-Thorsten


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net