Translations of this page?:

stable_partition

#include <algorithm>
 
template< class BidirectionalIterator, class UnaryPredicate >
BidirectionalIterator stable_partition( BidirectionalIterator first, BidirectionalIterator last,
                                        UnaryPredicate p );

Reorders the elements in the range [first, last) in such a way that all elements for which the predicate p returns true precede the elements for which predicate p returns false. Relative order of the elements is preserved.

Parameters

first, last - the range to be reordered

p - unary predicate

Return value

iterator to the first element of the second group

Complexity

linear in distance between first and last

See also

 
• • • SitemapRecent changesRSScc