From Jason Turner

[range.access.begin]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpdoudiapu/{from.md → to.md} +8 -16
tmp/tmpdoudiapu/{from.md → to.md} RENAMED
@@ -6,31 +6,23 @@ The name `ranges::begin` 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::begin(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::begin(E)` is
13
  ill-formed with no diagnostic required.
14
  - Otherwise, if `T` is an array type, `ranges::begin(E)` is
15
  expression-equivalent to `t + 0`.
16
- - Otherwise, if `decay-copy(t.begin())` is a valid expression whose type
17
  models `input_or_output_iterator`, `ranges::begin(E)` is
18
- expression-equivalent to `decay-copy(t.begin())`.
19
- - Otherwise, if `T` is a class or enumeration type and
20
- `decay-copy(begin(t))` is a valid expression whose type models
21
- `input_or_output_iterator` with overload resolution performed in a
22
- context in which unqualified lookup for `begin` finds only the
23
- declarations
24
- ``` cpp
25
- void begin(auto&) = delete;
26
- void begin(const auto&) = delete;
27
- ```
28
-
29
- then `ranges::begin(E)` is expression-equivalent to
30
- `decay-copy(begin(t))` with overload resolution performed in the above
31
- context.
32
  - Otherwise, `ranges::begin(E)` is ill-formed.
33
 
34
  [*Note 1*: Diagnosable ill-formed cases above result in substitution
35
  failure when `ranges::begin(E)` appears in the immediate context of a
36
  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::begin(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::begin(E)` is
13
  ill-formed with no diagnostic required.
14
  - Otherwise, if `T` is an array type, `ranges::begin(E)` is
15
  expression-equivalent to `t + 0`.
16
+ - Otherwise, if `auto(t.begin())` is a valid expression whose type
17
  models `input_or_output_iterator`, `ranges::begin(E)` is
18
+ expression-equivalent to `auto(t.begin())`.
19
+ - Otherwise, if `T` is a class or enumeration type and `auto(begin(t))`
20
+ is a valid expression whose type models `input_or_output_iterator`
21
+ where the meaning of `begin` is established as-if by performing
22
+ argument-dependent lookup only [[basic.lookup.argdep]], then
23
+ `ranges::begin(E)` is expression-equivalent to that expression.
 
 
 
 
 
 
 
 
24
  - Otherwise, `ranges::begin(E)` is ill-formed.
25
 
26
  [*Note 1*: Diagnosable ill-formed cases above result in substitution
27
  failure when `ranges::begin(E)` appears in the immediate context of a
28
  template instantiation. — *end note*]