dune-common 2.10
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
Dune::Std::default_accessor< Element > Class Template Reference

A type for indexed access to elements of mdspan. More...

#include <dune/common/std/default_accessor.hh>

Public Types

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

Public Member Functions

constexpr default_accessor () noexcept=default
 Default constructor.
 
template<class OtherElement , std::enable_if_t< std::is_convertible_v< OtherElement(*)[], Element(*)[]>, int > = 0>
constexpr default_accessor (default_accessor< OtherElement >) noexcept
 Converting constructor from an accessor with different element type.
 
constexpr reference access (data_handle_type p, std::size_t i) const noexcept
 Return a reference to the i'th element in the data range starting at p
 
constexpr data_handle_type offset (data_handle_type p, std::size_t i) const noexcept
 Return a data handle to the i'th element in the data range starting at p
 

Detailed Description

template<class Element>
class Dune::Std::default_accessor< Element >

A type for indexed access to elements of mdspan.

The default_accessor class template is the default AccessorPolicy used by mdspan if no user-specified accessor policy is provided.

Template Parameters
ElementThe element type. Shall be a complete object type that is neither an abstract class type nor an array type. Otherwise, the program is ill-formed.

Member Typedef Documentation

◆ data_handle_type

template<class Element >
using Dune::Std::default_accessor< Element >::data_handle_type = element_type*

◆ element_type

template<class Element >
using Dune::Std::default_accessor< Element >::element_type = Element

◆ offset_policy

template<class Element >
using Dune::Std::default_accessor< Element >::offset_policy = default_accessor

◆ reference

template<class Element >
using Dune::Std::default_accessor< Element >::reference = element_type&

Constructor & Destructor Documentation

◆ default_accessor() [1/2]

template<class Element >
constexpr Dune::Std::default_accessor< Element >::default_accessor ( )
constexprdefaultnoexcept

Default constructor.

◆ default_accessor() [2/2]

template<class Element >
template<class OtherElement , std::enable_if_t< std::is_convertible_v< OtherElement(*)[], Element(*)[]>, int > = 0>
constexpr Dune::Std::default_accessor< Element >::default_accessor ( default_accessor< OtherElement >  )
inlineconstexprnoexcept

Converting constructor from an accessor with different element type.

Member Function Documentation

◆ access()

template<class Element >
constexpr reference Dune::Std::default_accessor< Element >::access ( data_handle_type  p,
std::size_t  i 
) const
inlineconstexprnoexcept

Return a reference to the i'th element in the data range starting at p

◆ offset()

template<class Element >
constexpr data_handle_type Dune::Std::default_accessor< Element >::offset ( data_handle_type  p,
std::size_t  i 
) const
inlineconstexprnoexcept

Return a data handle to the i'th element in the data range starting at p


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