Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
std::stable_partition is an STL algorithm to partition elements in a container by a certain predicate, preserving the order of the elements. For example, in the code shown below, a std::vector is partitioned into primes and non-primes.
#include <algorithm> |
Screen output:
Primes: 1 2 3 5 7 |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.