AccessorPolicy defines how elements are accessed from a given data handle to such elements and an index. It is used as a policy in std::mdspan to specify the access to a reference of an element using an underlying 1D index.
[edit] RequirementsA type A
satisfies AccessorPolicy if it models copyable
, and the following are true:
And, given the following types and values, the expressions shown in the table below are valid and have the indicated semantics:
[edit] Legend Type DefinitionA
an accessor policy type OP
an offset policy type Value Definition a a value of type (possibly const-qualified) A
p a value of type (possibly const-qualified) A::data_handle_type
i, j, n values of type std::size_t [edit] Member types
[edit] Member functions Expression Return type Semantics a.access(p, i) typename A::reference
::data_handle_type
[
â0â,
n)
is an accessible range (see below) of p and a.[
â0â,
n - i)
is an accessible range of q and b; and[
â0â,
n - i)
.A range of indices [
â0â,
N)
is an accessible range of a given data handle and an accessor if, for each index in the range, the access member function produces a valid reference to an element.
The following standard library types satisfy AccessorPolicy requirements:
a type for indexed access to elements ofmdspan
mdspan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4