tmp/tmptoyn_qo5/{from.md → to.md}
RENAMED
|
@@ -8,19 +8,21 @@ template<class BidirectionalIterator>
|
|
| 8 |
template<class BidirectionalIterator, class Compare>
|
| 9 |
bool next_permutation(BidirectionalIterator first,
|
| 10 |
BidirectionalIterator last, Compare comp);
|
| 11 |
```
|
| 12 |
|
|
|
|
|
|
|
|
|
|
| 13 |
*Effects:* Takes a sequence defined by the range \[`first`, `last`) and
|
| 14 |
transforms it into the next permutation. The next permutation is found
|
| 15 |
by assuming that the set of all permutations is lexicographically sorted
|
| 16 |
-
with respect to `operator<` or `comp`.
|
| 17 |
-
returns `true`. Otherwise, it transforms the sequence into the smallest
|
| 18 |
-
permutation, that is, the ascendingly sorted one, and returns `false`.
|
| 19 |
|
| 20 |
-
*
|
| 21 |
-
|
|
|
|
| 22 |
|
| 23 |
*Complexity:* At most `(last - first) / 2` swaps.
|
| 24 |
|
| 25 |
``` cpp
|
| 26 |
template<class BidirectionalIterator>
|
|
@@ -30,19 +32,19 @@ template<class BidirectionalIterator>
|
|
| 30 |
template<class BidirectionalIterator, class Compare>
|
| 31 |
bool prev_permutation(BidirectionalIterator first,
|
| 32 |
BidirectionalIterator last, Compare comp);
|
| 33 |
```
|
| 34 |
|
|
|
|
|
|
|
|
|
|
| 35 |
*Effects:* Takes a sequence defined by the range \[`first`, `last`) and
|
| 36 |
transforms it into the previous permutation. The previous permutation is
|
| 37 |
found by assuming that the set of all permutations is lexicographically
|
| 38 |
sorted with respect to `operator<` or `comp`.
|
| 39 |
|
| 40 |
*Returns:* `true` if such a permutation exists. Otherwise, it transforms
|
| 41 |
the sequence into the largest permutation, that is, the descendingly
|
| 42 |
sorted one, and returns `false`.
|
| 43 |
|
| 44 |
-
*Requires:* `BidirectionalIterator` shall satisfy the requirements of
|
| 45 |
-
`ValueSwappable` ([[swappable.requirements]]).
|
| 46 |
-
|
| 47 |
*Complexity:* At most `(last - first) / 2` swaps.
|
| 48 |
|
|
|
|
| 8 |
template<class BidirectionalIterator, class Compare>
|
| 9 |
bool next_permutation(BidirectionalIterator first,
|
| 10 |
BidirectionalIterator last, Compare comp);
|
| 11 |
```
|
| 12 |
|
| 13 |
+
*Requires:* `BidirectionalIterator` shall satisfy the requirements of
|
| 14 |
+
`ValueSwappable` ([[swappable.requirements]]).
|
| 15 |
+
|
| 16 |
*Effects:* Takes a sequence defined by the range \[`first`, `last`) and
|
| 17 |
transforms it into the next permutation. The next permutation is found
|
| 18 |
by assuming that the set of all permutations is lexicographically sorted
|
| 19 |
+
with respect to `operator<` or `comp`.
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
*Returns:* `true` if such a permutation exists. Otherwise, it transforms
|
| 22 |
+
the sequence into the smallest permutation, that is, the ascendingly
|
| 23 |
+
sorted one, and returns `false`.
|
| 24 |
|
| 25 |
*Complexity:* At most `(last - first) / 2` swaps.
|
| 26 |
|
| 27 |
``` cpp
|
| 28 |
template<class BidirectionalIterator>
|
|
|
|
| 32 |
template<class BidirectionalIterator, class Compare>
|
| 33 |
bool prev_permutation(BidirectionalIterator first,
|
| 34 |
BidirectionalIterator last, Compare comp);
|
| 35 |
```
|
| 36 |
|
| 37 |
+
*Requires:* `BidirectionalIterator` shall satisfy the requirements of
|
| 38 |
+
`ValueSwappable` ([[swappable.requirements]]).
|
| 39 |
+
|
| 40 |
*Effects:* Takes a sequence defined by the range \[`first`, `last`) and
|
| 41 |
transforms it into the previous permutation. The previous permutation is
|
| 42 |
found by assuming that the set of all permutations is lexicographically
|
| 43 |
sorted with respect to `operator<` or `comp`.
|
| 44 |
|
| 45 |
*Returns:* `true` if such a permutation exists. Otherwise, it transforms
|
| 46 |
the sequence into the largest permutation, that is, the descendingly
|
| 47 |
sorted one, and returns `false`.
|
| 48 |
|
|
|
|
|
|
|
|
|
|
| 49 |
*Complexity:* At most `(last - first) / 2` swaps.
|
| 50 |
|