remove |
Remove all matching items from a sequence.
Remove all occurrences of value
from the sequence [ first ...
last ). Return an iterator equal to last -
n , where n equals
the number of elements removed. The size of the container is not altered. If
n elements are removed, the last n elements of
the sequence [ first ... last
) have undefined values.
#include <algorithm>
template< class ForwardIterator, class T >
ForwardIterator remove
(
ForwardIterator first,
ForwardIterator last,
const T& value
);
Time complexity is linear, as (
last - first )
comparisons are performed. Space complexity is constant.
Copyright©1994-2026 Recursion Software LLC
All Rights Reserved - For use by licensed users only.