Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions std/algorithm/sorting.d
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,20 @@ Checks whether a forward range is sorted according to the comparison
operation $(D less). Performs $(BIGOH r.length) evaluations of $(D
less).

Unlike $(LREF isSorted), $(LREF isStrictlyMonotonic) does not allow for equal values,
Unlike `isSorted`, `isStrictlyMonotonic` does not allow for equal values,
i.e. values for which both `less(a, b)` and `less(b, a)` are false.

With either function, the predicate must be a strict ordering just like with
$(LREF isSorted). For example, using `"a <= b"` instead of `"a < b"` is
`isSorted`. For example, using `"a <= b"` instead of `"a < b"` is
incorrect and will cause failed assertions.

Params:
less = Predicate the range should be sorted by.
r = Forward range to check for sortedness.

Returns:
`true` if the range is sorted, false otherwise. $(LREF isSorted) allows
duplicates, $(LREF isStrictlyMonotonic) not.
`true` if the range is sorted, false otherwise. `isSorted` allows
duplicates, `isStrictlyMonotonic` not.
*/
bool isSorted(alias less = "a < b", Range)(Range r) if (isForwardRange!(Range))
{
Expand Down