|
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AccessorPolicy defines how elements are accessed from a given data handle to such elements and an index. It is used as a policy instd::mdspan to specify the access to a reference of an element using an underlying 1D index.
Contents |
A typeA satisfiesAccessorPolicy if it modelscopyable, and the following aretrue:
And, given the following types and values, the expressions shown in the table below are valid and have the indicated semantics:
| Type | Definition |
A | 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 typestd::size_t |
| Type | Definition | Requirements |
|---|---|---|
A::element_type | unspecified |
|
A::data_handle_type | unspecified[1] |
|
A::reference | unspecified[2] |
|
A::offset_policy | OP |
|
| Expression | Return type | Semantics |
|---|---|---|
| a.access(p, i) | typename A::reference |
|
| a.offset(p, i) | typename A::offset_policy ::data_handle_type |
|
A range of indices[0, N) is anaccessible range of a given data handle and an accessor if, for each index in the range, theaccess member function produces a valid reference to an element.
The following standard library types satisfyAccessorPolicy requirements:
(C++23) | a type for indexed access to elements ofmdspan(class template)[edit] |
(C++26) | a type for aligned access to elements ofmdspan(class template)[edit] |
Defined in namespace std::linalg | |
(C++26) | std::mdspan accessor policy whose reference represents the product of a scaling factor that is fixed and its nestedstd::mdspan accessor's reference (class template)[edit] |
(C++26) | std::mdspan accessor policy whose reference represents the complex conjugate of its nestedstd::mdspan accessor's reference (class template)[edit] |