From Jason Turner

[iterator.cust.swap]

Diff to HTML by rtfpessoa

tmp/tmps3a42ftb/{from.md → to.md} RENAMED
@@ -35,19 +35,22 @@ The expression `ranges::iter_swap(E1, E2)` for subexpressions `E1` and
35
 
36
  and does not include a declaration of `ranges::iter_swap`. If the
37
  function selected by overload resolution does not exchange the values
38
  denoted by `E1` and `E2`, the program is ill-formed, no diagnostic
39
  required.
 
 
 
40
  - Otherwise, if the types of `E1` and `E2` each model
41
  `indirectly_readable`, and if the reference types of `E1` and `E2`
42
  model `swappable_with` [[concept.swappable]], then
43
  `ranges::swap(*E1, *E2)`.
44
  - Otherwise, if the types `T1` and `T2` of `E1` and `E2` model
45
  `indirectly_movable_storable<T1, T2>` and
46
  `indirectly_movable_storable<T2, T1>`, then
47
  `(void)(*E1 = iter-exchange-move(E2, E1))`, except that `E1` is
48
  evaluated only once.
49
- - Otherwise, `ranges::iter_swap(E1, E2)` is ill-formed. \[*Note 1*: This
50
  case can result in substitution failure when
51
  `ranges::iter_swap(E1, E2)` appears in the immediate context of a
52
  template instantiation. — *end note*]
53
 
 
35
 
36
  and does not include a declaration of `ranges::iter_swap`. If the
37
  function selected by overload resolution does not exchange the values
38
  denoted by `E1` and `E2`, the program is ill-formed, no diagnostic
39
  required.
40
+ \[*Note 1*: This precludes calling unconstrained `std::iter_swap`.
41
+ When the deleted overload is viable, program-defined overloads need to
42
+ be more specialized [[temp.func.order]] to be selected. — *end note*]
43
  - Otherwise, if the types of `E1` and `E2` each model
44
  `indirectly_readable`, and if the reference types of `E1` and `E2`
45
  model `swappable_with` [[concept.swappable]], then
46
  `ranges::swap(*E1, *E2)`.
47
  - Otherwise, if the types `T1` and `T2` of `E1` and `E2` model
48
  `indirectly_movable_storable<T1, T2>` and
49
  `indirectly_movable_storable<T2, T1>`, then
50
  `(void)(*E1 = iter-exchange-move(E2, E1))`, except that `E1` is
51
  evaluated only once.
52
+ - Otherwise, `ranges::iter_swap(E1, E2)` is ill-formed. \[*Note 2*: This
53
  case can result in substitution failure when
54
  `ranges::iter_swap(E1, E2)` appears in the immediate context of a
55
  template instantiation. — *end note*]
56