It removes all elements equal to 99 from container c .
std::remove does not actually remove any elements. It moves all the elements of interest to the second part of the container, and returns an iterator indicating the first of them. The erase member function erase takes an iterator range to actually remove items from the container.
See erase-delete idiom .
source share