tmp/tmpk0zbbkj8/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### `ranges::begin` <a id="range.access.begin">[[range.access.begin]]</a>
|
| 2 |
+
|
| 3 |
+
The name `ranges::begin` denotes a customization point object
|
| 4 |
+
[[customization.point.object]].
|
| 5 |
+
|
| 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*]
|
| 37 |
+
|
| 38 |
+
[*Note 2*: Whenever `ranges::begin(E)` is a valid expression, its type
|
| 39 |
+
models `input_or_output_iterator`. — *end note*]
|
| 40 |
+
|