tmp/tmpnifu4bab/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,79 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
##### Requirements <a id="mdspan.accessor.reqmts">[[mdspan.accessor.reqmts]]</a>
|
| 2 |
+
|
| 3 |
+
A type `A` meets the accessor policy requirements if
|
| 4 |
+
|
| 5 |
+
- `A` models `copyable`,
|
| 6 |
+
- `is_nothrow_move_constructible_v<A>` is `true`,
|
| 7 |
+
- `is_nothrow_move_assignable_v<A>` is `true`,
|
| 8 |
+
- `is_nothrow_swappable_v<A>` is `true`, and
|
| 9 |
+
- the following types and expressions are well-formed and have the
|
| 10 |
+
specified semantics.
|
| 11 |
+
|
| 12 |
+
``` cpp
|
| 13 |
+
typename A::element_type
|
| 14 |
+
```
|
| 15 |
+
|
| 16 |
+
*Result:* A complete object type that is not an abstract class type.
|
| 17 |
+
|
| 18 |
+
``` cpp
|
| 19 |
+
typename A::data_handle_type
|
| 20 |
+
```
|
| 21 |
+
|
| 22 |
+
*Result:* A type that models `copyable`, and for which
|
| 23 |
+
`is_nothrow_move_constructible_v<A::data_handle_type>` is `true`,
|
| 24 |
+
`is_nothrow_move_assignable_v<A::data_handle_type>` is `true`, and
|
| 25 |
+
`is_nothrow_swappable_v<A::data_handle_type>` is `true`.
|
| 26 |
+
|
| 27 |
+
[*Note 1*: The type of `data_handle_type` need not be
|
| 28 |
+
`element_type*`. — *end note*]
|
| 29 |
+
|
| 30 |
+
``` cpp
|
| 31 |
+
typename A::reference
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
*Result:* A type that models
|
| 35 |
+
`common_reference_with<A::reference&&, A::element_type&>`.
|
| 36 |
+
|
| 37 |
+
[*Note 2*: The type of `reference` need not be
|
| 38 |
+
`element_type&`. — *end note*]
|
| 39 |
+
|
| 40 |
+
``` cpp
|
| 41 |
+
typename A::offset_policy
|
| 42 |
+
```
|
| 43 |
+
|
| 44 |
+
*Result:* A type `OP` such that:
|
| 45 |
+
|
| 46 |
+
- `OP` meets the accessor policy requirements,
|
| 47 |
+
- `constructible_from<OP, const A&>` is modeled, and
|
| 48 |
+
- `is_same_v<typename OP::element_type, typename A::element_type>` is
|
| 49 |
+
`true`.
|
| 50 |
+
|
| 51 |
+
``` cpp
|
| 52 |
+
a.access(p, i)
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
*Result:* `A::reference`
|
| 56 |
+
|
| 57 |
+
*Remarks:* The expression is equality preserving.
|
| 58 |
+
|
| 59 |
+
[*Note 3*: Concrete accessor policies can impose preconditions for
|
| 60 |
+
their `access` function. However, they might not. For example, an
|
| 61 |
+
accessor where `p` is `span<A::element_type, dynamic_extent>` and
|
| 62 |
+
`access(p, i)` returns `p[i % p.size()]` does not need to impose a
|
| 63 |
+
precondition on `i`. — *end note*]
|
| 64 |
+
|
| 65 |
+
``` cpp
|
| 66 |
+
a.offset(p, i)
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
*Result:* `A::offset_policy::data_handle_type`
|
| 70 |
+
|
| 71 |
+
*Returns:* `q` such that for `b` being `A::offset_policy(a)`, and any
|
| 72 |
+
integer `n` for which [0, `n`) is an accessible range of `p` and `a`:
|
| 73 |
+
|
| 74 |
+
- [0, `n` - `i`) is an accessible range of `q` and `b`; and
|
| 75 |
+
- `b.access(q, j)` provides access to the same element as
|
| 76 |
+
`a.access(p, i + j)`, for every `j` in the range [0, `n` - `i`).
|
| 77 |
+
|
| 78 |
+
*Remarks:* The expression is equality-preserving.
|
| 79 |
+
|