conditionalSwap

Conditionally pairwise sort elements of Range r at indexes using comparison predicate less.

TODO: Perhaps defines as

template conditionalSwap(indexes...) { void conditionalSwap(less = "a < b", Range)(Range r) { } }

instead.

void
conditionalSwap
(
alias less = "a < b"
Range
indexes...
)
(
Range r
)
if (
isRandomAccessRange!Range &&
allSatisfy!(isIntegral, typeof(indexes))
&&
indexes.length
&&
(indexes.length & 1) == 0
)

Meta