The function partition is used to change the order of the elements so that the elements that meet the criteria are first in order.
template<class BidirectionalIterator, class Predicate> BidirectionalIterator partition (BidirectionalIterator first, BidirectionalIterator last, Predicate pred);
Returns an iterator to the first position where the predicate argument is false.