If a range is sorted, range algorithms should take advantage of it.
For a motivation you may also read:
https://github.com/dlang/phobos/pull/3534
Since three weeks `find` has a specialization for SortedRanges
https://github.com/dlang/phobos/pull/4907
and more functions could take advantage of a similar behavior (e.g. minPos, minElement, minIndex, isSorted, ...)
Moreover I would like to stress that at the moment the comparison is done with a string lambda, which means that for user-defined lambdas we can't take any advantage at the moment.
Comment #1 by robert.schadek — 2024-12-01T16:29:01Z