
19 Mar
2009
19 Mar
'09
5:56 p.m.
AMDG 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);
or
A* el; iterator it = std::find (lst.begin(), lst.end(), el); delete lst.erase(el);
erase deletes the element and returns an iterator to the next element. In Christ, Steven Watanabe