Boost logo

Boost Users :

Subject: Re: [Boost-users] proper erasing from ptr_vector
From: Thorsten Ottosen (thorsten.ottosen_at_[hidden])
Date: 2009-03-23 09:24:02

Steven Watanabe skrev:
> Archie14 wrote:
>> ptr_vector<A> lst;
>> When I need to erase element from this container - should I just do A*
>> el;
>> iterator it = std::find (lst.begin(), lst.end(), el);
>> lst.erase(it);

Replace "A* el" with "A el". Objects are compared not by their pointer
value, but by the paointee.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at