Suppose I have a std::vector objs (for performance reasons I have pointers not actual Objs).
std::vector objs
Obj
I populate it with obj.push
obj.push
Instead of trying to solve the deletion problem, you can make it go away completely by storing shared_ptrs in the vector, or by using boost's ptr_vector (see http://www.boost.org/doc/libs/1_39_0/libs/ptr_container/doc/tutorial.html).
shared_ptr
ptr_vector