The erase-remove idiom is a common C++ technique to eliminate elements that fulfill a certain criterion from a C++ Standard Library container.
Instead of removing elements, remove operator puts elements, that doesn't match criteria, at the end of given range and then returns an iterator pointing one element past the last matching element. Then the erase member function deletes elements from returned iterator to the given one.
More information can be found at Wikipedia.