stable_partition

Syntax:

    #include <algorithm>
    iterator stable_partition( iterator start, iterator end, Predicate p );

The stable_partition() function behaves similarily to partition(). The difference between the two algorithms is that stable_partition() will preserve the initial ordering of the elements in the two groups.

Related Topics: partition