Skip to content

Commit a9c72cb

Browse files
committed
mentions second sorted arg and requirements
1 parent 3bb32e7 commit a9c72cb

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,15 @@ for (auto&& i : compress(ivec, bvec) {
340340

341341
sorted
342342
------
343-
Allows iteration over a sequence in sorted order. `sorted()` does
343+
Allows iteration over a sequence in sorted order. `sorted` does
344344
**not** produce a new sequence, copy elements, or modify the original
345345
sequence. It only provides a way to iterate over existing elements.
346+
`sorted` also takes an optional second
347+
[comparator](http://en.cppreference.com/w/cpp/concept/Compare)
348+
argument. If not provided, defaults to `std::less`. <br />
349+
Iterables passed to sorted are required to have an iterator with
350+
an `operator*() const` member.
351+
346352
The below outputs `0 1 2 3 4`.
347353

348354
```c++

0 commit comments

Comments
 (0)