mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 07:30:33 +03:00
Fix Issue 20751 - SortedRange with ref predicate parameters fails
isTwoWayCompatible should accept functions with ref parameters.
This commit is contained in:
parent
9844c34196
commit
54dbc0668c
2 changed files with 24 additions and 11 deletions
|
@ -2067,6 +2067,17 @@ if (((ss == SwapStrategy.unstable && (hasSwappableElements!Range ||
|
|||
r.sort();
|
||||
assert(proxySwapCalled);
|
||||
}
|
||||
|
||||
// https://issues.dlang.org/show_bug.cgi?id=20751
|
||||
{
|
||||
static bool refPred(ref int a, ref int b)
|
||||
{
|
||||
return a < b;
|
||||
}
|
||||
|
||||
auto sortedArr = [5,4,3,2,1].sort!refPred;
|
||||
sortedArr.equalRange(3);
|
||||
}
|
||||
}
|
||||
|
||||
private void quickSortImpl(alias less, Range)(Range r, size_t depth)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue