mirror of
https://github.com/dlang/phobos.git
synced 2025-05-06 11:07:39 +03:00
fix Issue 7878 - A problem with purity and general templated algorithms
This commit is contained in:
parent
803aa7ccb0
commit
e2c892fdbf
2 changed files with 10 additions and 104 deletions
|
@ -6782,7 +6782,8 @@ sort(alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable,
|
|||
Range)(Range r)
|
||||
{
|
||||
alias binaryFun!(less) lessFun;
|
||||
static if (is(typeof(lessFun(r.front, r.front)) == bool))
|
||||
alias typeof(lessFun(r.front, r.front)) LessRet; // instantiate lessFun
|
||||
static if (is(LessRet == bool))
|
||||
{
|
||||
sortImpl!(lessFun, ss)(r);
|
||||
static if(is(typeof(text(r))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue