partition3

fnauto partition3(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, E)(Range r, E pivot) if (ss == SwapStrategy.unstable && isRandomAccessRange!Range && hasSwappableElements!Range && hasLength!Range && hasSlicing!Range && is(typeof(binaryFun!less(r.front, pivot)) == bool) && is(typeof(binaryFun!less(pivot, r.front)) == bool) && is(typeof(binaryFun!less(r.front, r.front)) == bool))

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.

Parameters

lessThe predicate to use for the rearrangement.
ssThe swapping strategy to use.
rThe random-access range to rearrange.
pivotThe pivot element.

Returns

A Tuple of the three resulting ranges. These ranges are

slices of the original range.

BUGS: stable partition3 has not been implemented yet.