From Jason Turner

[range.access.end]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpedpk_hf8/{from.md → to.md} +9 -16
tmp/tmpedpk_hf8/{from.md → to.md} RENAMED
@@ -6,32 +6,25 @@ The name `ranges::end` denotes a customization point object
6
  Given a subexpression `E` with type `T`, let `t` be an lvalue that
7
  denotes the reified object for `E`. Then:
8
 
9
  - If `E` is an rvalue and `enable_borrowed_range<remove_cv_t<T>>` is
10
  `false`, `ranges::end(E)` is ill-formed.
11
- - Otherwise, if `T` is an array type [[basic.compound]] and
12
  `remove_all_extents_t<T>` is an incomplete type, `ranges::end(E)` is
13
  ill-formed with no diagnostic required.
14
  - Otherwise, if `T` is an array of unknown bound, `ranges::end(E)` is
15
  ill-formed.
16
  - Otherwise, if `T` is an array, `ranges::end(E)` is
17
  expression-equivalent to `t + extent_v<T>`.
18
- - Otherwise, if `decay-copy(t.end())` is a valid expression whose type
19
- models `sentinel_for<iterator_t<T>>` then `ranges::end(E)` is
20
- expression-equivalent to `decay-copy(t.end())`.
21
- - Otherwise, if `T` is a class or enumeration type and
22
- `decay-copy(end(t))` is a valid expression whose type models
23
- `sentinel_for<iterator_t<T>>` with overload resolution performed in a
24
- context in which unqualified lookup for `end` finds only the
25
- declarations
26
- ``` cpp
27
- void end(auto&) = delete;
28
- void end(const auto&) = delete;
29
- ```
30
-
31
- then `ranges::end(E)` is expression-equivalent to `decay-copy(end(t))`
32
- with overload resolution performed in the above context.
33
  - Otherwise, `ranges::end(E)` is ill-formed.
34
 
35
  [*Note 1*: Diagnosable ill-formed cases above result in substitution
36
  failure when `ranges::end(E)` appears in the immediate context of a
37
  template instantiation. — *end note*]
 
6
  Given a subexpression `E` with type `T`, let `t` be an lvalue that
7
  denotes the reified object for `E`. Then:
8
 
9
  - If `E` is an rvalue and `enable_borrowed_range<remove_cv_t<T>>` is
10
  `false`, `ranges::end(E)` is ill-formed.
11
+ - Otherwise, if `T` is an array type [[term.array.type]] and
12
  `remove_all_extents_t<T>` is an incomplete type, `ranges::end(E)` is
13
  ill-formed with no diagnostic required.
14
  - Otherwise, if `T` is an array of unknown bound, `ranges::end(E)` is
15
  ill-formed.
16
  - Otherwise, if `T` is an array, `ranges::end(E)` is
17
  expression-equivalent to `t + extent_v<T>`.
18
+ - Otherwise, if `auto(t.end())` is a valid expression whose type models
19
+ `sentinel_for<iterator_t<T>>` then `ranges::end(E)` is
20
+ expression-equivalent to `auto(t.end())`.
21
+ - Otherwise, if `T` is a class or enumeration type and `auto(end(t))` is
22
+ a valid expression whose type models `sentinel_for<iterator_t<T>>`
23
+ where the meaning of `end` is established as-if by performing
24
+ argument-dependent lookup only [[basic.lookup.argdep]], then
25
+ `ranges::end(E)` is expression-equivalent to that expression.
 
 
 
 
 
 
 
26
  - Otherwise, `ranges::end(E)` is ill-formed.
27
 
28
  [*Note 1*: Diagnosable ill-formed cases above result in substitution
29
  failure when `ranges::end(E)` appears in the immediate context of a
30
  template instantiation. — *end note*]