![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
Accessor policy for mdspan which returns values from a compile time sequence.
More...
Public Types | |
| using | data_handle_type = std::size_t |
| The type of the data handle — this is the index into the sequence from which to start the accesses. | |
| using | element_type = ElementType |
| The type of the element. | |
| using | offset_policy = constant_sequence_accessor |
The type of the accessor policy for accessing data with an offset — this is constant_sequence_accessor , since the value is constant. | |
| using | reference = ElementType |
| The type of a "reference" to the element — this is the same as the element type, so no backing data is required, the value is returned by value. | |
Static Public Member Functions | |
| static constexpr auto | access (data_handle_type data_handle, std::size_t index) noexcept -> reference |
| Return the value for the given data handle and index. The index is ignored as the value is always constant. | |
| static constexpr auto | offset (data_handle_type data_handle, std::size_t index) noexcept -> data_handle_type |
| Return the data handle value to use with the offset policy for the given data handle and index. | |
Accessor policy for mdspan which returns values from a compile time sequence.
| Sequence | A type holding the sequence of values. This must either be: |
value_type that is the type of the elements, as per std::integer_sequence , orvalue_type that is the type of the elements, a static member function size() for the size of the sequence that is callable in a constant expression, and a static member function values() that returns something convertible to an array of Sequence::size() elements of type Sequence::value_type that is callable in a constant expression | ElementType | the type of the element. The element type of Sequence must be convertible to the ElementType , which must be an object type that is not an abstract type. |
| using arene::base::constant_sequence_accessor< Sequence, ElementType >::data_handle_type = std::size_t |
The type of the data handle — this is the index into the sequence from which to start the accesses.
| using arene::base::constant_sequence_accessor< Sequence, ElementType >::element_type = ElementType |
The type of the element.
| using arene::base::constant_sequence_accessor< Sequence, ElementType >::offset_policy = constant_sequence_accessor |
The type of the accessor policy for accessing data with an offset — this is constant_sequence_accessor , since the value is constant.
| using arene::base::constant_sequence_accessor< Sequence, ElementType >::reference = ElementType |
The type of a "reference" to the element — this is the same as the element type, so no backing data is required, the value is returned by value.
|
inlinestaticconstexprnoexcept |
Return the value for the given data handle and index. The index is ignored as the value is always constant.
| data_handle | The base position into the sequence to use |
| index | The index value to the chosen item from the base position |
(data_handle+index) (data_handle+index) must be less than Sequence::size()
|
inlinestaticconstexprnoexcept |
Return the data handle value to use with the offset policy for the given data handle and index.
| data_handle | The base position into the sequence to use |
| index | The index value to the chosen item from the base position |
(data_handle+index)