Loading...
Searching...
No Matches
Dune::Std::default_accessor< Element > Class Template Reference
Common » Utilities » C++ utilities and backports

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

  Element | The 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>

Dune::Std::default_accessor< Element >::default_accessor | ( |  | ) |

constexpr default noexcept

Default constructor.

## default_accessor() [2/2]

template<class Element>
template<class OtherElement, std::enable_if_t< std::is_convertible_v< OtherElement(*)[], Element(*)[]>, int > = 0>

Dune::Std::default_accessor< Element >::default_accessor | ( | default_accessor< OtherElement > |  | ) |

inline constexpr noexcept

Converting constructor from an accessor with different element type.

## Member Function Documentation

## access()

template<class Element>

reference Dune::Std::default_accessor< Element >::access | ( | data_handle_type | p,
|  | std::size_t | i ) const

inline constexpr noexcept

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

## offset()

template<class Element>

data_handle_type Dune::Std::default_accessor< Element >::offset | ( | data_handle_type | p,
|  | std::size_t | i ) const

inline constexpr noexcept

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:

- default_accessor.hh