cpp/algorithm/remove

Removes all elements satisfying specific criteria from the range and returns a past-the-end iterator for the new end of the range.

@1@ Removes all elements that are equal to (using ). @3@ Removes all elements for which predicate returns. @2,4@ Same as, but executed according to.

Removing is done by shifting (by means of ) the elements in the range in such a way that the elements that are not to be removed appear in the beginning of the range. Relative order of the elements that remain is preserved and the physical size of the container is unchanged. Iterators pointing to an element between the new logical end and the physical end of the range are still dereferenceable.

Return value
Past-the-end iterator for the new range of values (if this is not, then it points to an unspecified value, and so do iterators to any values between this iterator and ).

Complexity
Given as : @1,2@ exactly comparisons with  using @3,4@ exactly applications of the predicate