The predicate to use for the rearrangement.
The swapping strategy to use.
The random-access range to rearrange.
The pivot element.
A std.typecons.Tuple of the three resulting ranges. These ranges are slices of the original range.
stable partition3 has not been implemented yet.
auto a = [ 8, 3, 4, 1, 4, 7, 4 ]; auto pieces = partition3(a, 4); assert(pieces[0] == [ 1, 3 ]); assert(pieces[1] == [ 4, 4, 4 ]); assert(pieces[2] == [ 8, 7 ]);
Rearranges elements in r in three adjacent ranges and returns them.
The first and leftmost range only contains elements in r less than pivot. The second and middle range only contains elements in r that are equal to pivot. Finally, the third and rightmost range only contains elements in r that are greater than pivot. The less-than test is defined by the binary function less.