Reputation: 131970
std::partition
is nifty, but it is in-place; and std::partition_copy
is also nice, but it takes two output iterators, i.e. you have to at least count in advance the number of elements satisfying the predicate if you want to use the same output array. Why isn't there an out-of-place std::partition
, or a single-output-iterator std::partition_copy
, in <algorithm>
?
Upvotes: 2
Views: 150
Reputation: 96281
Presumably because the functionality can already be attained by either:
partition
.begin()
and rbegin()
iterators to fill it from the front and back with partition_copy
.Upvotes: 3