mirror of
https://github.com/dlang/phobos.git
synced 2025-05-01 15:40:36 +03:00
Merge pull request #544 from 9rnsr/fix7878
Issue 7878 - A problem with purity and general templated algorithms
This commit is contained in:
commit
8e37bf3d01
2 changed files with 11 additions and 105 deletions
|
@ -6977,7 +6977,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