Partition
C++ offers a few functions for dealing with partitions. All of them need a unary predicate pre
. std::partition
and std::stable_partition
partition a range and returns the partition point. With std::partition_point
you can get the partition point of a partition. Afterwards you can check the partition with std::is_partitioned
or copy it with std::partition_copy
.
Checks if the range is partitioned:
Partitions the range: