tmp/tmpdur5j1ca/{from.md → to.md}
RENAMED
|
@@ -1,21 +1,18 @@
|
|
| 1 |
-
### Customization
|
| 2 |
|
| 3 |
#### `ranges::iter_move` <a id="iterator.cust.move">[[iterator.cust.move]]</a>
|
| 4 |
|
| 5 |
The name `ranges::iter_move` denotes a customization point object
|
| 6 |
[[customization.point.object]]. The expression `ranges::iter_move(E)`
|
| 7 |
for a subexpression `E` is expression-equivalent to:
|
| 8 |
|
| 9 |
- `iter_move(E)`, if `E` has class or enumeration type and
|
| 10 |
`iter_move(E)` is a well-formed expression when treated as an
|
| 11 |
-
unevaluated operand,
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
``` cpp
|
| 15 |
-
void iter_move();
|
| 16 |
-
```
|
| 17 |
- Otherwise, if the expression `*E` is well-formed:
|
| 18 |
- if `*E` is an lvalue, `std::move(*E)`;
|
| 19 |
- otherwise, `*E`.
|
| 20 |
- Otherwise, `ranges::iter_move(E)` is ill-formed. \[*Note 1*: This case
|
| 21 |
can result in substitution failure when `ranges::iter_move(E)` appears
|
|
@@ -61,19 +58,22 @@ The expression `ranges::iter_swap(E1, E2)` for subexpressions `E1` and
|
|
| 61 |
|
| 62 |
and does not include a declaration of `ranges::iter_swap`. If the
|
| 63 |
function selected by overload resolution does not exchange the values
|
| 64 |
denoted by `E1` and `E2`, the program is ill-formed, no diagnostic
|
| 65 |
required.
|
|
|
|
|
|
|
|
|
|
| 66 |
- Otherwise, if the types of `E1` and `E2` each model
|
| 67 |
`indirectly_readable`, and if the reference types of `E1` and `E2`
|
| 68 |
model `swappable_with` [[concept.swappable]], then
|
| 69 |
`ranges::swap(*E1, *E2)`.
|
| 70 |
- Otherwise, if the types `T1` and `T2` of `E1` and `E2` model
|
| 71 |
`indirectly_movable_storable<T1, T2>` and
|
| 72 |
`indirectly_movable_storable<T2, T1>`, then
|
| 73 |
`(void)(*E1 = iter-exchange-move(E2, E1))`, except that `E1` is
|
| 74 |
evaluated only once.
|
| 75 |
-
- Otherwise, `ranges::iter_swap(E1, E2)` is ill-formed. \[*Note
|
| 76 |
case can result in substitution failure when
|
| 77 |
`ranges::iter_swap(E1, E2)` appears in the immediate context of a
|
| 78 |
template instantiation. — *end note*]
|
| 79 |
|
|
|
|
| 1 |
+
### Customization point objects <a id="iterator.cust">[[iterator.cust]]</a>
|
| 2 |
|
| 3 |
#### `ranges::iter_move` <a id="iterator.cust.move">[[iterator.cust.move]]</a>
|
| 4 |
|
| 5 |
The name `ranges::iter_move` denotes a customization point object
|
| 6 |
[[customization.point.object]]. The expression `ranges::iter_move(E)`
|
| 7 |
for a subexpression `E` is expression-equivalent to:
|
| 8 |
|
| 9 |
- `iter_move(E)`, if `E` has class or enumeration type and
|
| 10 |
`iter_move(E)` is a well-formed expression when treated as an
|
| 11 |
+
unevaluated operand, where the meaning of `iter_move` is established
|
| 12 |
+
as-if by performing argument-dependent lookup only
|
| 13 |
+
[[basic.lookup.argdep]].
|
|
|
|
|
|
|
|
|
|
| 14 |
- Otherwise, if the expression `*E` is well-formed:
|
| 15 |
- if `*E` is an lvalue, `std::move(*E)`;
|
| 16 |
- otherwise, `*E`.
|
| 17 |
- Otherwise, `ranges::iter_move(E)` is ill-formed. \[*Note 1*: This case
|
| 18 |
can result in substitution failure when `ranges::iter_move(E)` appears
|
|
|
|
| 58 |
|
| 59 |
and does not include a declaration of `ranges::iter_swap`. If the
|
| 60 |
function selected by overload resolution does not exchange the values
|
| 61 |
denoted by `E1` and `E2`, the program is ill-formed, no diagnostic
|
| 62 |
required.
|
| 63 |
+
\[*Note 1*: This precludes calling unconstrained `std::iter_swap`.
|
| 64 |
+
When the deleted overload is viable, program-defined overloads need to
|
| 65 |
+
be more specialized [[temp.func.order]] to be selected. — *end note*]
|
| 66 |
- Otherwise, if the types of `E1` and `E2` each model
|
| 67 |
`indirectly_readable`, and if the reference types of `E1` and `E2`
|
| 68 |
model `swappable_with` [[concept.swappable]], then
|
| 69 |
`ranges::swap(*E1, *E2)`.
|
| 70 |
- Otherwise, if the types `T1` and `T2` of `E1` and `E2` model
|
| 71 |
`indirectly_movable_storable<T1, T2>` and
|
| 72 |
`indirectly_movable_storable<T2, T1>`, then
|
| 73 |
`(void)(*E1 = iter-exchange-move(E2, E1))`, except that `E1` is
|
| 74 |
evaluated only once.
|
| 75 |
+
- Otherwise, `ranges::iter_swap(E1, E2)` is ill-formed. \[*Note 2*: This
|
| 76 |
case can result in substitution failure when
|
| 77 |
`ranges::iter_swap(E1, E2)` appears in the immediate context of a
|
| 78 |
template instantiation. — *end note*]
|
| 79 |
|