https://issues.dlang.org/show_bug.cgi?id=12216
Seb <[email protected]> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |[email protected] --- Comment #1 from Seb <[email protected]> --- This is going to be tough because some templates are written like this: foo() if (a) foo() if (!a) There overloading is rather hard. However, the following trick should always work: --- bool isSorted(alias less = "a < b", Range)(Range r) { import std.algorithm : isSortedImpl = isSorted; static if (isStaticArray!Range) { return isSortedImpl!less(r[]); } else { return isSortedImpl!less(r[]); } } --- https://run.dlang.io/is/EL3VEj Though nowadays this isn't even necessary for isSorted. --
