std::is_partitioned
Template:cpp/algorithm/sidebar Template:ddcl list begin <tr class="t-dsc-header">
<td><algorithm>
<td></td> <td></td> </tr> <tr class="t-dcl ">
<td class="t-dcl-nopad">bool is_partitioned(InputIterator first, InputIterator last, UnaryPredicate p);
<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end
Returns Template:cpp if all elements in the range [first, last)
that satisfy the predicate p
appear before all elements that don't. Also returns Template:cpp if [first, last)
is empty.
Contents |
Parameters
first, last | - | the range of elements to check |
p | - | unary predicate which returns true for the elements expected to be found in the beginning of the range. The expression p(v) must be convertible to bool for every argument |
Return value
Template:cpp if the range [first, last)
is empty or is partitioned by p
. Template:cpp otherwise.
Complexity
At most std::distance(first, last)
applications of p
.