tmp/tmpbpeadb9g/{from.md → to.md}
RENAMED
|
@@ -1,33 +1,45 @@
|
|
| 1 |
### Reverse <a id="alg.reverse">[[alg.reverse]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class BidirectionalIterator>
|
| 5 |
void reverse(BidirectionalIterator first, BidirectionalIterator last);
|
|
|
|
|
|
|
|
|
|
| 6 |
```
|
| 7 |
|
| 8 |
-
*Effects:* For each non-negative integer `i < (last - first)/2`, applies
|
| 9 |
-
`iter_swap` to all pairs of iterators `first + i, (last - i) - 1`.
|
| 10 |
-
|
| 11 |
*Requires:* `*first` shall be swappable ([[swappable.requirements]]).
|
| 12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
*Complexity:* Exactly `(last - first)/2` swaps.
|
| 14 |
|
| 15 |
``` cpp
|
| 16 |
template<class BidirectionalIterator, class OutputIterator>
|
| 17 |
OutputIterator
|
| 18 |
-
reverse_copy(BidirectionalIterator first,
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
```
|
| 21 |
|
|
|
|
|
|
|
|
|
|
| 22 |
*Effects:* Copies the range \[`first`, `last`) to the range \[`result`,
|
| 23 |
`result + (last - first)`) such that for every non-negative integer
|
| 24 |
`i < (last - first)` the following assignment takes place:
|
| 25 |
`*(result + (last - first) - 1 - i) = *(first + i)`.
|
| 26 |
|
| 27 |
-
*Requires:* The ranges \[`first`, `last`) and \[`result`,
|
| 28 |
-
`result+(last-first)`) shall not overlap.
|
| 29 |
-
|
| 30 |
*Returns:* `result + (last - first)`.
|
| 31 |
|
| 32 |
*Complexity:* Exactly `last - first` assignments.
|
| 33 |
|
|
|
|
| 1 |
### Reverse <a id="alg.reverse">[[alg.reverse]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
template<class BidirectionalIterator>
|
| 5 |
void reverse(BidirectionalIterator first, BidirectionalIterator last);
|
| 6 |
+
template<class ExecutionPolicy, class BidirectionalIterator>
|
| 7 |
+
void reverse(ExecutionPolicy&& exec,
|
| 8 |
+
BidirectionalIterator first, BidirectionalIterator last);
|
| 9 |
```
|
| 10 |
|
|
|
|
|
|
|
|
|
|
| 11 |
*Requires:* `*first` shall be swappable ([[swappable.requirements]]).
|
| 12 |
|
| 13 |
+
*Effects:* For each non-negative integer `i < (last - first) / 2`,
|
| 14 |
+
applies `iter_swap` to all pairs of iterators
|
| 15 |
+
`first + i, (last - i) - 1`.
|
| 16 |
+
|
| 17 |
+
*Requires:* `BidirectionalIterator` shall satisfy the requirements of
|
| 18 |
+
`ValueSwappable` ([[swappable.requirements]]).
|
| 19 |
+
|
| 20 |
*Complexity:* Exactly `(last - first)/2` swaps.
|
| 21 |
|
| 22 |
``` cpp
|
| 23 |
template<class BidirectionalIterator, class OutputIterator>
|
| 24 |
OutputIterator
|
| 25 |
+
reverse_copy(BidirectionalIterator first, BidirectionalIterator last,
|
| 26 |
+
OutputIterator result);
|
| 27 |
+
template<class ExecutionPolicy, class BidirectionalIterator, class ForwardIterator>
|
| 28 |
+
ForwardIterator
|
| 29 |
+
reverse_copy(ExecutionPolicy&& exec,
|
| 30 |
+
BidirectionalIterator first, BidirectionalIterator last,
|
| 31 |
+
ForwardIterator result);
|
| 32 |
```
|
| 33 |
|
| 34 |
+
*Requires:* The ranges \[`first`, `last`) and \[`result`,
|
| 35 |
+
`result + (last - first)`) shall not overlap.
|
| 36 |
+
|
| 37 |
*Effects:* Copies the range \[`first`, `last`) to the range \[`result`,
|
| 38 |
`result + (last - first)`) such that for every non-negative integer
|
| 39 |
`i < (last - first)` the following assignment takes place:
|
| 40 |
`*(result + (last - first) - 1 - i) = *(first + i)`.
|
| 41 |
|
|
|
|
|
|
|
|
|
|
| 42 |
*Returns:* `result + (last - first)`.
|
| 43 |
|
| 44 |
*Complexity:* Exactly `last - first` assignments.
|
| 45 |
|