Boost logo

Boost Users :

Subject: [Boost-users] proper erasing from ptr_vector
From: Archie14 (admin_at_[hidden])
Date: 2009-03-19 13:25:18


I have

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);

or

A* el;
iterator it = std::find (lst.begin(), lst.end(), el);
delete lst.erase(el);


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