tmp/tmp7ps5ychz/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
###### Overview <a id="mdspan.accessor.default.overview">[[mdspan.accessor.default.overview]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
template<class ElementType>
|
| 6 |
+
struct default_accessor {
|
| 7 |
+
using offset_policy = default_accessor;
|
| 8 |
+
using element_type = ElementType;
|
| 9 |
+
using reference = ElementType&;
|
| 10 |
+
using data_handle_type = ElementType*;
|
| 11 |
+
|
| 12 |
+
constexpr default_accessor() noexcept = default;
|
| 13 |
+
template<class OtherElementType>
|
| 14 |
+
constexpr default_accessor(default_accessor<OtherElementType>) noexcept;
|
| 15 |
+
constexpr reference access(data_handle_type p, size_t i) const noexcept;
|
| 16 |
+
constexpr data_handle_type offset(data_handle_type p, size_t i) const noexcept;
|
| 17 |
+
};
|
| 18 |
+
}
|
| 19 |
+
```
|
| 20 |
+
|
| 21 |
+
`default_accessor` meets the accessor policy requirements.
|
| 22 |
+
|
| 23 |
+
`ElementType` is required to be a complete object type that is neither
|
| 24 |
+
an abstract class type nor an array type.
|
| 25 |
+
|
| 26 |
+
Each specialization of `default_accessor` is a trivially copyable type
|
| 27 |
+
that models `semiregular`.
|
| 28 |
+
|
| 29 |
+
[0, n) is an accessible range for an object `p` of type
|
| 30 |
+
`data_handle_type` and an object of type `default_accessor` if and only
|
| 31 |
+
if \[`p`, `p + `n) is a valid range.
|
| 32 |
+
|