std::partition
From cppreference.com
Defined in header <algorithm>
|
||
template< class ForwardIt, class UnaryPred > ForwardIt partition( ForwardIt first, ForwardIt last, UnaryPred p ); |
(1) | (constexpr since C++20) |
template< class ExecutionPolicy, class ForwardIt, class UnaryPred > ForwardIt partition( ExecutionPolicy&& policy, |
(2) | (since C++17) |
1) Reorders the elements in the range
[
first,
last)
in such a way that all elements for which the predicate p returns true precede all elements for which predicate p returns false. Relative order of the elements is not preserved. 2) Same as (1), but executed according to policy.
This overload participates in overload resolution only if all following conditions are satisfied:
std::is_execution_policy_v<std::decay_t<ExecutionPolicy>> is true. |
(until C++20) |
std::is_execution_policy_v<std::remove_cvref_t<ExecutionPolicy>> is true. |
(since C++20) |
If the type of *first is not Swappable(until C++11)ForwardIt
is not ValueSwappable(since C++11), the behavior is undefined.
Contents |