tmp/tmpnxiazd1e/{from.md → to.md}
RENAMED
|
@@ -12,26 +12,34 @@ template<class ExecutionPolicy, class ForwardIterator>
|
|
| 12 |
|
| 13 |
template<permutable I, sentinel_for<I> S>
|
| 14 |
constexpr subrange<I> ranges::shift_left(I first, S last, iter_difference_t<I> n);
|
| 15 |
template<forward_range R>
|
| 16 |
requires permutable<iterator_t<R>>
|
| 17 |
-
constexpr borrowed_subrange_t<R> ranges::shift_left(R&& r, range_difference_t<R> n)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
```
|
| 19 |
|
| 20 |
*Preconditions:* `n >= 0` is `true`. For the overloads in namespace
|
| 21 |
`std`, the type of `*first` meets the *Cpp17MoveAssignable*
|
| 22 |
requirements.
|
| 23 |
|
| 24 |
*Effects:* If `n == 0` or `n >= last - first`, does nothing. Otherwise,
|
| 25 |
moves the element from position `first + n + i` into position
|
| 26 |
`first + i` for each non-negative integer `i < (last - first) - n`. For
|
| 27 |
-
the
|
| 28 |
-
|
| 29 |
-
`i = (last - first) - n - 1`.
|
| 30 |
|
| 31 |
*Returns:* Let *NEW_LAST* be `first + (last - first - n)` if
|
| 32 |
-
`n < last - first`, otherwise `first`.
|
| 33 |
|
| 34 |
- *NEW_LAST* for the overloads in namespace `std`.
|
| 35 |
- `{first, `*`NEW_LAST`*`}` for the overloads in namespace `ranges`.
|
| 36 |
|
| 37 |
*Complexity:* At most `(last - first) - n` assignments.
|
|
@@ -49,10 +57,19 @@ template<class ExecutionPolicy, class ForwardIterator>
|
|
| 49 |
template<permutable I, sentinel_for<I> S>
|
| 50 |
constexpr subrange<I> ranges::shift_right(I first, S last, iter_difference_t<I> n);
|
| 51 |
template<forward_range R>
|
| 52 |
requires permutable<iterator_t<R>>
|
| 53 |
constexpr borrowed_subrange_t<R> ranges::shift_right(R&& r, range_difference_t<R> n);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
```
|
| 55 |
|
| 56 |
*Preconditions:* `n >= 0` is `true`. For the overloads in namespace
|
| 57 |
`std`, the type of `*first` meets the *Cpp17MoveAssignable*
|
| 58 |
requirements, and `ForwardIterator` meets the
|
|
@@ -61,20 +78,19 @@ the *Cpp17ValueSwappable* requirements.
|
|
| 61 |
|
| 62 |
*Effects:* If `n == 0` or `n >= last - first`, does nothing. Otherwise,
|
| 63 |
moves the element from position `first + i` into position
|
| 64 |
`first + n + i` for each non-negative integer `i < (last - first) - n`.
|
| 65 |
Does so in order starting from `i = (last - first) - n - 1` and
|
| 66 |
-
proceeding to `i = 0` if
|
| 67 |
|
| 68 |
-
- for the overload in namespace `std`
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
`bidirectional_iterator`.
|
| 73 |
|
| 74 |
*Returns:* Let *NEW_FIRST* be `first + n` if `n < last - first`,
|
| 75 |
-
otherwise `last`.
|
| 76 |
|
| 77 |
- *NEW_FIRST* for the overloads in namespace `std`.
|
| 78 |
- `{`*`NEW_FIRST`*`, last}` for the overloads in namespace `ranges`.
|
| 79 |
|
| 80 |
*Complexity:* At most `(last - first) - n` assignments or swaps.
|
|
|
|
| 12 |
|
| 13 |
template<permutable I, sentinel_for<I> S>
|
| 14 |
constexpr subrange<I> ranges::shift_left(I first, S last, iter_difference_t<I> n);
|
| 15 |
template<forward_range R>
|
| 16 |
requires permutable<iterator_t<R>>
|
| 17 |
+
constexpr borrowed_subrange_t<R> ranges::shift_left(R&& r, range_difference_t<R> n);
|
| 18 |
+
|
| 19 |
+
template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
|
| 20 |
+
requires permutable<I>
|
| 21 |
+
subrange<I>
|
| 22 |
+
ranges::shift_left(Ep&& exec, I first, S last, iter_difference_t<I> n);
|
| 23 |
+
template<execution-policy Ep, sized-random-access-range R>
|
| 24 |
+
requires permutable<iterator_t<R>>
|
| 25 |
+
borrowed_subrange_t<R>
|
| 26 |
+
ranges::shift_left(Ep&& exec, R&& r, range_difference_t<R> n);
|
| 27 |
```
|
| 28 |
|
| 29 |
*Preconditions:* `n >= 0` is `true`. For the overloads in namespace
|
| 30 |
`std`, the type of `*first` meets the *Cpp17MoveAssignable*
|
| 31 |
requirements.
|
| 32 |
|
| 33 |
*Effects:* If `n == 0` or `n >= last - first`, does nothing. Otherwise,
|
| 34 |
moves the element from position `first + n + i` into position
|
| 35 |
`first + i` for each non-negative integer `i < (last - first) - n`. For
|
| 36 |
+
the non-parallel algorithm overloads, does so in order starting from
|
| 37 |
+
`i = 0` and proceeding to `i = (last - first) - n - 1`.
|
|
|
|
| 38 |
|
| 39 |
*Returns:* Let *NEW_LAST* be `first + (last - first - n)` if
|
| 40 |
+
`n < last - first`, otherwise `first`. Returns:
|
| 41 |
|
| 42 |
- *NEW_LAST* for the overloads in namespace `std`.
|
| 43 |
- `{first, `*`NEW_LAST`*`}` for the overloads in namespace `ranges`.
|
| 44 |
|
| 45 |
*Complexity:* At most `(last - first) - n` assignments.
|
|
|
|
| 57 |
template<permutable I, sentinel_for<I> S>
|
| 58 |
constexpr subrange<I> ranges::shift_right(I first, S last, iter_difference_t<I> n);
|
| 59 |
template<forward_range R>
|
| 60 |
requires permutable<iterator_t<R>>
|
| 61 |
constexpr borrowed_subrange_t<R> ranges::shift_right(R&& r, range_difference_t<R> n);
|
| 62 |
+
|
| 63 |
+
template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S>
|
| 64 |
+
requires permutable<I>
|
| 65 |
+
subrange<I>
|
| 66 |
+
ranges::shift_right(Ep&& exec, I first, S last, iter_difference_t<I> n);
|
| 67 |
+
template<execution-policy Ep, sized-random-access-range R>
|
| 68 |
+
requires permutable<iterator_t<R>>
|
| 69 |
+
borrowed_subrange_t<R>
|
| 70 |
+
ranges::shift_right(Ep&& exec, R&& r, range_difference_t<R> n);
|
| 71 |
```
|
| 72 |
|
| 73 |
*Preconditions:* `n >= 0` is `true`. For the overloads in namespace
|
| 74 |
`std`, the type of `*first` meets the *Cpp17MoveAssignable*
|
| 75 |
requirements, and `ForwardIterator` meets the
|
|
|
|
| 78 |
|
| 79 |
*Effects:* If `n == 0` or `n >= last - first`, does nothing. Otherwise,
|
| 80 |
moves the element from position `first + i` into position
|
| 81 |
`first + n + i` for each non-negative integer `i < (last - first) - n`.
|
| 82 |
Does so in order starting from `i = (last - first) - n - 1` and
|
| 83 |
+
proceeding to `i = 0` if
|
| 84 |
|
| 85 |
+
- for the non-parallel algorithm overload in namespace `std`,
|
| 86 |
+
`ForwardIterator` meets the *Cpp17BidirectionalIterator* requirements,
|
| 87 |
+
- for the non-parallel algorithm overloads in namespace `ranges`, `I`
|
| 88 |
+
models `bidirectional_iterator`.
|
|
|
|
| 89 |
|
| 90 |
*Returns:* Let *NEW_FIRST* be `first + n` if `n < last - first`,
|
| 91 |
+
otherwise `last`. Returns:
|
| 92 |
|
| 93 |
- *NEW_FIRST* for the overloads in namespace `std`.
|
| 94 |
- `{`*`NEW_FIRST`*`, last}` for the overloads in namespace `ranges`.
|
| 95 |
|
| 96 |
*Complexity:* At most `(last - first) - n` assignments or swaps.
|