Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
Aleph::default_accessor< ElementType > Struct Template Reference

Trivial accessor policy: access(p, i) is just p[i]. More...

#include <ah-mdspan.H>

Inheritance diagram for Aleph::default_accessor< ElementType >:
[legend]

Public Types

using offset_policy = default_accessor
 
using element_type = ElementType
 
using reference = ElementType &
 
using data_handle_type = ElementType *
 

Public Member Functions

constexpr default_accessor () noexcept=default
 
template<class OtherElementType >
requires std::is_convertible_v<OtherElementType (*)[], element_type (*)[]>
constexpr default_accessor (default_accessor< OtherElementType >) noexcept
 
constexpr reference access (data_handle_type p, size_t i) const noexcept
 Access an element from a pointer and an offset.
 
constexpr data_handle_type offset (data_handle_type p, size_t i) const noexcept
 

Detailed Description

template<class ElementType>
struct Aleph::default_accessor< ElementType >

Trivial accessor policy: access(p, i) is just p[i].

This is the only accessor policy this polyfill provides (matching std::default_accessor); custom accessors (atomic views, checked views, ...) are out of scope for this header.

Definition at line 525 of file ah-mdspan.H.

Member Typedef Documentation

◆ data_handle_type

Definition at line 530 of file ah-mdspan.H.

◆ element_type

Definition at line 528 of file ah-mdspan.H.

◆ offset_policy

Definition at line 527 of file ah-mdspan.H.

◆ reference

Definition at line 529 of file ah-mdspan.H.

Constructor & Destructor Documentation

◆ default_accessor() [1/2]

template<class ElementType >
constexpr Aleph::default_accessor< ElementType >::default_accessor ( )
constexprdefaultnoexcept

◆ default_accessor() [2/2]

template<class ElementType >
template<class OtherElementType >
requires std::is_convertible_v<OtherElementType (*)[], element_type (*)[]>
constexpr Aleph::default_accessor< ElementType >::default_accessor ( default_accessor< OtherElementType >  )
inlineconstexprnoexcept

Definition at line 536 of file ah-mdspan.H.

Member Function Documentation

◆ access()

template<class ElementType >
constexpr reference Aleph::default_accessor< ElementType >::access ( data_handle_type  p,
size_t  i 
) const
inlineconstexprnoexcept

Access an element from a pointer and an offset.

Parameters
pPointer to the start of the data.
iLinear offset.
Returns
A reference to the element at the specified offset.

Definition at line 544 of file ah-mdspan.H.

◆ offset()

template<class ElementType >
constexpr data_handle_type Aleph::default_accessor< ElementType >::offset ( data_handle_type  p,
size_t  i 
) const
inlineconstexprnoexcept

Definition at line 549 of file ah-mdspan.H.


The documentation for this struct was generated from the following file: