![]() |
Arene Base
Fundamental Utilities For Safety Critical C++
|
accesses a single element from a pointer and an index More...

Public Types | |
| using | data_handle_type = ElementType* |
| data handle type Refers to a group of elements. In this case, a pointer. | |
| using | element_type = ElementType |
| element type to access | |
| using | offset_policy = default_accessor |
| offset policy type | |
| using | reference = ElementType& |
| reference type Returned on element to access. In this case, an lvalue reference. | |
Public Member Functions | |
| constexpr | default_accessor () noexcept=default |
| default constructor | |
| template<class OtherElementType, constraints< std::enable_if_t< std::is_convertible< OtherElementType(*)[], element_type(*)[]>::value > > = nullptr> | |
| constexpr | default_accessor (default_accessor< OtherElementType >) noexcept |
| converting constructor | |
| constexpr auto | access (data_handle_type ptr, std::size_t index) const noexcept -> reference |
| obtain the element at the specified index | |
| constexpr auto | offset (data_handle_type ptr, std::size_t index) const noexcept -> data_handle_type |
| apply an offset to a pointer | |
accesses a single element from a pointer and an index
| ElementType | complete object type that is accessed by default_accessor |
Backport of std::default_accessor from C++23. The default_accessor class template is the default AccessorPolicy of mdspan if no user-specified accessor policy is provided. It defines the data_handle_type as a pointer to the ElementType and access will return a reference to the ElementType.
| using arene::base::default_accessor< ElementType >::data_handle_type = ElementType* |
data handle type Refers to a group of elements. In this case, a pointer.
| using arene::base::default_accessor< ElementType >::element_type = ElementType |
element type to access
| using arene::base::default_accessor< ElementType >::offset_policy = default_accessor |
offset policy type
| using arene::base::default_accessor< ElementType >::reference = ElementType& |
reference type Returned on element to access. In this case, an lvalue reference.
|
constexprdefaultnoexcept |
default constructor
|
inlineconstexprnoexcept |
converting constructor
| OtherElementType | element type of the other default_accessor |
|
inlineconstexprnoexcept |
obtain the element at the specified index
| ptr | pointer to an element |
| index | offset from the first element |
|
inlineconstexprnoexcept |
apply an offset to a pointer
| ptr | pointer to an element |
| index | offset to apply |