Cppreference only says:
Removes specified elements from the container. 1) Removes the element at pos. 2) Removes the elements in the range [first; last).
Invalidates iterators and references at or after the point of the erase, including the end() iterator.
The iterator pos must be valid and dereferenceable. Thus the end() iterator (which is valid, but is not dereferencable) cannot be used as a value for pos.
The iterator first does not need to be dereferenceable if first==last: erasing an empty range is a no-op.