Standard C++ Library Class Reference

Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
partition
Algorithm
Summary
Places all of the entities that satisfy the given predicate before all of the entities that do not.
Contents
Synopsis
Description
Complexity
Example
Warning
See Also
Synopsis
#include <algorithm>
template <class BidirectionalIterator, class Predicate>
BidirectionalIterator
partition (BidirectionalIterator first,
BidirectionalIterator last,
Predicate pred);
Description
The partition algorithm places all the elements in the range [first, last) that satisfy pred before
all the elements that do not satisfy pred. It returns an iterator that is one past the end of the
group of elements that satisfy pred. In other words, partition returns i such that for any iterator j