Low-Level Abstraction of Memory Access
llama::ArrayExtents< T, Sizes > Struct Template Reference

#include <ArrayExtents.hpp>

+ Inheritance diagram for llama::ArrayExtents< T, Sizes >:
+ Collaboration diagram for llama::ArrayExtents< T, Sizes >:

Public Types

using Index = ArrayIndex< T, rank >
 
using value_type = T
 
- Public Types inherited from llama::Array< std::size_t,((Sizes==dyn)+...+0)>
using value_type = std::size_t
 

Public Member Functions

template<std::size_t I>
constexpr auto get () const -> value_type
 
constexpr auto operator[] (T i) const -> value_type
 
constexpr auto toArray () const -> Index
 
- Public Member Functions inherited from llama::Array< std::size_t,((Sizes==dyn)+...+0)>
constexpr auto size () const
 
constexpr auto empty () const -> bool
 
constexpr auto begin () -> std::size_t *
 
constexpr auto begin () const -> const std::size_t *
 
constexpr auto end () -> std::size_t *
 
constexpr auto end () const -> const std::size_t *
 
constexpr auto front () -> std::size_t &
 
constexpr auto front () const -> const std::size_t &
 
constexpr auto back () -> std::size_t &
 
constexpr auto back () const -> const std::size_t &
 
constexpr auto operator[] (IndexType &&idx) -> std::size_t &
 
constexpr auto operator[] (IndexType &&idx) const -> const std::size_t &
 
constexpr auto data () -> std::size_t *
 
constexpr auto data () const -> const std::size_t *
 
constexpr auto get () -> std::size_t &
 
constexpr auto get () const -> const std::size_t &
 

Static Public Attributes

static constexpr std::size_t rank = sizeof...(Sizes)
 
static constexpr auto rankDynamic = ((Sizes == dyn) + ... + 0)
 
static constexpr auto rankStatic = rank - rankDynamic
 

Additional Inherited Members

- Public Attributes inherited from llama::Array< std::size_t,((Sizes==dyn)+...+0)>
std::size_t element [N]
 

Detailed Description

template<typename T = std::size_t, T... Sizes>
struct llama::ArrayExtents< T, Sizes >

ArrayExtents holding compile and runtime indices. This is conceptually equivalent to the std::extent of std::mdspan (

See also
: https://wg21.link/P0009) including the changes to make the size_type controllable (
: https://wg21.link/P2553).

Definition at line 134 of file ArrayExtents.hpp.

Member Typedef Documentation

◆ Index

template<typename T = std::size_t, T... Sizes>
using llama::ArrayExtents< T, Sizes >::Index = ArrayIndex<T, rank>

Definition at line 140 of file ArrayExtents.hpp.

◆ value_type

template<typename T = std::size_t, T... Sizes>
using llama::ArrayExtents< T, Sizes >::value_type = T

Definition at line 141 of file ArrayExtents.hpp.

Member Function Documentation

◆ get()

template<typename T = std::size_t, T... Sizes>
template<std::size_t I>
constexpr auto llama::ArrayExtents< T, Sizes >::get ( ) const -> value_type
inlineconstexpr

Definition at line 144 of file ArrayExtents.hpp.

◆ operator[]()

template<typename T = std::size_t, T... Sizes>
constexpr auto llama::ArrayExtents< T, Sizes >::operator[] ( i) const -> value_type
inlineconstexpr

Definition at line 155 of file ArrayExtents.hpp.

◆ toArray()

template<typename T = std::size_t, T... Sizes>
constexpr auto llama::ArrayExtents< T, Sizes >::toArray ( ) const -> Index
inlineconstexpr

Definition at line 168 of file ArrayExtents.hpp.

Member Data Documentation

◆ rank

template<typename T = std::size_t, T... Sizes>
constexpr std::size_t llama::ArrayExtents< T, Sizes >::rank = sizeof...(Sizes)
staticconstexpr

Definition at line 136 of file ArrayExtents.hpp.

◆ rankDynamic

template<typename T = std::size_t, T... Sizes>
constexpr auto llama::ArrayExtents< T, Sizes >::rankDynamic = ((Sizes == dyn) + ... + 0)
staticconstexpr

Definition at line 137 of file ArrayExtents.hpp.

◆ rankStatic

template<typename T = std::size_t, T... Sizes>
constexpr auto llama::ArrayExtents< T, Sizes >::rankStatic = rank - rankDynamic
staticconstexpr

Definition at line 138 of file ArrayExtents.hpp.


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