C++ Language/Std/Stl/CollectionClasses/SequenceCollections/Vector/RemovingItems

The  function removes an iterator-specified item from the vector, but doesn't do anything to that removed item. So if the item-type was a pointer, then you would still be responsible for any manual destruction of the actual object.

To remove all items, use.

To remove the last item, use.

Additional information about removing items from a vector (includes interactive examples)