cpp/algorithm/ranges/partition

@1@ Reorders the elements in the range in such a way that the projection  of all elements for which the predicate  returns  precede the projection  of elements for which predicate  returns. Relative order of elements is not preserved.

@2@ Same as, but uses as the source range, as if using  as  and  as.

Return value
A subrange starting with an iterator to the first element of the second group and finishing with an iterator equal to. returns std if is an rvalue of non- type.

Complexity
Given, exactly $N$ applications of the predicate and projection. At most $N / 2$ swaps if models ranges, and at most $N$ swaps otherwise.