Switch std.algorithm/.range to lambda syntax

String lambdas are, of course, still supported.
This commit is contained in:
Brad Anderson 2012-07-20 19:09:30 -06:00
parent 17ba4bb594
commit 32eb03a983
2 changed files with 255 additions and 232 deletions

File diff suppressed because it is too large Load diff

View file

@ -6468,7 +6468,7 @@ enum SearchPolicy
assert(!r.contains(42)); // passes although it shouldn't
----
*/
struct SortedRange(Range, alias pred = "a < b")
struct SortedRange(Range, alias pred = ((a, b) => a < b))
if (isRandomAccessRange!Range)
{
private alias binaryFun!pred predFun;
@ -6979,7 +6979,7 @@ unsorted range failing the test is very high (however, an
almost-sorted range is likely to pass it). To check for sortedness at
cost $(BIGOH n), use $(XREF algorithm,isSorted).
*/
auto assumeSorted(alias pred = "a < b", R)(R r)
auto assumeSorted(alias pred = ((a, b) => a < b), R)(R r)
if (isRandomAccessRange!(Unqual!R))
{
return SortedRange!(Unqual!R, pred)(r);