cpp/algorithm/ranges/remove

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

@1@ Removes all elements that are equal to, using to compare. @3@ Removes all elements for which returns. @2,4@ Same as, but uses as the range, as if using  as  and  as.

Removing is done by shifting (by means of move assignment) 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, but the elements themselves have unspecified values (as per post-condition).

Return value
, where is the resulting subrange after removal, and the elements in subrange  are all in valid but unspecified state.

Complexity
Exactly applications of the corresponding predicate and any projection, where, and  move operations at worst.