sortingPredicate

Given a SortedRange R, sortingPredicate!R(a, b) will call in to the * predicate that was used to create the SortedRange. * * Params: * Range = the range to extract the predicate from * fallbackPred = the sorting predicate to fallback to if Range is not a SortedRange

Members

Aliases

sortingPredicate
alias sortingPredicate = binaryFun!(P[1])
Undocumented in source.
sortingPredicate
alias sortingPredicate = binaryFun!fallbackPred
Undocumented in source.

Examples

import std.algorithm : sort;
assert(sortingPredicate!(typeof([1].sort!"a < b"))(1, 2) == true);
assert(sortingPredicate!(typeof([1].sort!"a > b"))(1, 2) == false);
assert(sortingPredicate!(typeof([1].sort!((a, b) => a < b)))(1, 2) == true);
assert(sortingPredicate!(typeof([1].sort!((a, b) => a > b)))(1, 2) == false);
assert(sortingPredicate!(int[])(1, 2) == true);

Meta