From Jason Turner

[alg.move]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp156v3hrv/{from.md → to.md} +32 -10
tmp/tmp156v3hrv/{from.md → to.md} RENAMED
@@ -13,11 +13,11 @@ template<input_range R, weakly_incrementable O>
13
  requires indirectly_movable<iterator_t<R>, O>
14
  constexpr ranges::move_result<borrowed_iterator_t<R>, O>
15
  ranges::move(R&& r, O result);
16
  ```
17
 
18
- Let E be
19
 
20
  - `std::move(*(first + `n`))` for the overload in namespace `std`;
21
  - `ranges::iter_move(first + `n`)` for the overloads in namespace
22
  `ranges`.
23
 
@@ -26,36 +26,58 @@ Let N be `last - first`.
26
  *Preconditions:* `result` is not in the range \[`first`, `last`).
27
 
28
  *Effects:* Moves elements in the range \[`first`, `last`) into the range
29
  \[`result`, `result + `N) starting from `first` and proceeding to
30
  `last`. For each non-negative integer n < N, performs
31
- `*(result + `n`) = `E.
32
 
33
  *Returns:*
34
 
35
  - `result + `N for the overload in namespace `std`.
36
  - `{last, result + `N`}` for the overloads in namespace `ranges`.
37
 
38
  *Complexity:* Exactly N assignments.
39
 
40
  ``` cpp
41
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
42
- ForwardIterator2 move(ExecutionPolicy&& policy,
43
  ForwardIterator1 first, ForwardIterator1 last,
44
  ForwardIterator2 result);
 
 
 
 
 
 
 
 
 
 
45
  ```
46
 
47
- Let N be `last - first`.
 
 
 
 
 
 
 
 
 
48
 
49
  *Preconditions:* The ranges \[`first`, `last`) and \[`result`,
50
  `result + `N) do not overlap.
51
 
52
- *Effects:* Moves elements in the range \[`first`, `last`) into the range
53
- \[`result`, `result + `N). For each non-negative integer n < N, performs
54
- `*(result + `n`) = std::move(*(first + `n`))`.
55
 
56
- *Returns:* `result + `N.
 
 
 
57
 
58
  *Complexity:* Exactly N assignments.
59
 
60
  ``` cpp
61
  template<class BidirectionalIterator1, class BidirectionalIterator2>
@@ -71,11 +93,11 @@ template<bidirectional_range R, bidirectional_iterator I>
71
  requires indirectly_movable<iterator_t<R>, I>
72
  constexpr ranges::move_backward_result<borrowed_iterator_t<R>, I>
73
  ranges::move_backward(R&& r, I result);
74
  ```
75
 
76
- Let E be
77
 
78
  - `std::move(*(last - `n`))` for the overload in namespace `std`;
79
  - `ranges::iter_move(last - `n`)` for the overloads in namespace
80
  `ranges`.
81
 
@@ -85,11 +107,11 @@ Let N be `last - first`.
85
 
86
  *Effects:* Moves elements in the range \[`first`, `last`) into the range
87
  \[`result - `N, `result`) starting from `last - 1` and proceeding to
88
  `first`.[^3]
89
 
90
- For each positive integer n ≤ N, performs `*(result - `n`) = `E.
91
 
92
  *Returns:*
93
 
94
  - `result - `N for the overload in namespace `std`.
95
  - `{last, result - `N`}` for the overloads in namespace `ranges`.
 
13
  requires indirectly_movable<iterator_t<R>, O>
14
  constexpr ranges::move_result<borrowed_iterator_t<R>, O>
15
  ranges::move(R&& r, O result);
16
  ```
17
 
18
+ Let E(n) be
19
 
20
  - `std::move(*(first + `n`))` for the overload in namespace `std`;
21
  - `ranges::iter_move(first + `n`)` for the overloads in namespace
22
  `ranges`.
23
 
 
26
  *Preconditions:* `result` is not in the range \[`first`, `last`).
27
 
28
  *Effects:* Moves elements in the range \[`first`, `last`) into the range
29
  \[`result`, `result + `N) starting from `first` and proceeding to
30
  `last`. For each non-negative integer n < N, performs
31
+ `*(result + `n`) = `E(n).
32
 
33
  *Returns:*
34
 
35
  - `result + `N for the overload in namespace `std`.
36
  - `{last, result + `N`}` for the overloads in namespace `ranges`.
37
 
38
  *Complexity:* Exactly N assignments.
39
 
40
  ``` cpp
41
  template<class ExecutionPolicy, class ForwardIterator1, class ForwardIterator2>
42
+ ForwardIterator2 move(ExecutionPolicy&& exec,
43
  ForwardIterator1 first, ForwardIterator1 last,
44
  ForwardIterator2 result);
45
+
46
+ template<execution-policy Ep, random_access_iterator I, sized_sentinel_for<I> S,
47
+ random_access_iterator O, sized_sentinel_for<O> OutS>
48
+ requires indirectly_movable<I, O>
49
+ ranges::move_result<I, O>
50
+ ranges::move(Ep&& exec, I first, S last, O result, OutS result_last);
51
+ template<execution-policy Ep, sized-random-access-range R, sized-random-access-range OutR>
52
+ requires indirectly_movable<iterator_t<R>, iterator_t<OutR>>
53
+ ranges::move_result<borrowed_iterator_t<R>, borrowed_iterator_t<OutR>>
54
+ ranges::move(Ep&& exec, R&& r, OutR&& result_r);
55
  ```
56
 
57
+ Let E(n) be:
58
+
59
+ - `std::move(*(first + `n`))` for the overload in namespace `std`;
60
+ - `ranges::iter_move(first + `n`)` for the overloads in namespace
61
+ `ranges`.
62
+
63
+ Let `result_last` be `result + (last - first)` for the overloads in
64
+ namespace `std`.
65
+
66
+ Let N be min(`last - first`, `result_last - result`).
67
 
68
  *Preconditions:* The ranges \[`first`, `last`) and \[`result`,
69
  `result + `N) do not overlap.
70
 
71
+ *Effects:* Moves elements in the range \[`first`, `first + `N) into the
72
+ range \[`result`, `result + `N). For each non-negative integer n < N,
73
+ performs `*(result + `n`) = `E(n).
74
 
75
+ *Returns:*
76
+
77
+ - `result + `N for the overload in namespace `std`.
78
+ - `{first + `N`, result + `N`}` for the overloads in namespace `ranges`.
79
 
80
  *Complexity:* Exactly N assignments.
81
 
82
  ``` cpp
83
  template<class BidirectionalIterator1, class BidirectionalIterator2>
 
93
  requires indirectly_movable<iterator_t<R>, I>
94
  constexpr ranges::move_backward_result<borrowed_iterator_t<R>, I>
95
  ranges::move_backward(R&& r, I result);
96
  ```
97
 
98
+ Let E(n) be
99
 
100
  - `std::move(*(last - `n`))` for the overload in namespace `std`;
101
  - `ranges::iter_move(last - `n`)` for the overloads in namespace
102
  `ranges`.
103
 
 
107
 
108
  *Effects:* Moves elements in the range \[`first`, `last`) into the range
109
  \[`result - `N, `result`) starting from `last - 1` and proceeding to
110
  `first`.[^3]
111
 
112
+ For each positive integer n ≤ N, performs `*(result - `n`) = `E(n).
113
 
114
  *Returns:*
115
 
116
  - `result - `N for the overload in namespace `std`.
117
  - `{last, result - `N`}` for the overloads in namespace `ranges`.