From Jason Turner

[iterator.cust]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpm5mnwi75/{from.md → to.md} +79 -0
tmp/tmpm5mnwi75/{from.md → to.md} RENAMED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Customization points <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, with overload resolution performed in a context
12
+ that does not include a declaration of `ranges::iter_move` but does
13
+ include the declaration
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
22
+ in the immediate context of a template instantiation. — *end note*]
23
+
24
+ If `ranges::iter_move(E)` is not equal to `*E`, the program is
25
+ ill-formed, no diagnostic required.
26
+
27
+ #### `ranges::iter_swap` <a id="iterator.cust.swap">[[iterator.cust.swap]]</a>
28
+
29
+ The name `ranges::iter_swap` denotes a customization point object
30
+ [[customization.point.object]] that exchanges the values
31
+ [[concept.swappable]] denoted by its arguments.
32
+
33
+ Let *`iter-exchange-move`* be the exposition-only function:
34
+
35
+ ``` cpp
36
+ template<class X, class Y>
37
+ constexpr iter_value_t<X> iter-exchange-move(X&& x, Y&& y)
38
+ noexcept(noexcept(iter_value_t<X>(iter_move(x))) &&
39
+ noexcept(*x = iter_move(y)));
40
+ ```
41
+
42
+ *Effects:* Equivalent to:
43
+
44
+ ``` cpp
45
+ iter_value_t<X> old_value(iter_move(x));
46
+ *x = iter_move(y);
47
+ return old_value;
48
+ ```
49
+
50
+ The expression `ranges::iter_swap(E1, E2)` for subexpressions `E1` and
51
+ `E2` is expression-equivalent to:
52
+
53
+ - `(void)iter_swap(E1, E2)`, if either `E1` or `E2` has class or
54
+ enumeration type and `iter_swap(E1, E2)` is a well-formed expression
55
+ with overload resolution performed in a context that includes the
56
+ declaration
57
+ ``` cpp
58
+ template<class I1, class I2>
59
+ void iter_swap(I1, I2) = delete;
60
+ ```
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 1*: 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
+