Gaia-ECS v0.9.3
A simple and powerful entity component system
Loading...
Searching...
No Matches
gaia::cnt::sarr< T, N > Class Template Reference

Fixed-size stack array with AoS storage. Interface compatiblity with std::array where it matters. More...

#include <sarray_impl.h>

Public Types

using value_type = T
 
using reference = T &
 
using const_reference = const T &
 
using pointer = T *
 
using const_pointer = const T *
 
using view_policy = mem::data_view_policy_aos< T >
 
using difference_type = sarr_detail::difference_type
 
using size_type = sarr_detail::size_type
 
using iterator = pointer
 
using const_iterator = const_pointer
 
using iterator_category = core::random_access_iterator_tag
 

Public Member Functions

constexpr sarr (core::zero_t) noexcept
 Explicit value-initialization constructor for call sites that want zero/value initialization to be obvious.
 
template<typename InputIt >
constexpr sarr (InputIt first, InputIt last) noexcept
 
constexpr sarr (std::initializer_list< T > il)
 
constexpr sarr (const sarr &other)=default
 
constexpr sarr (sarr &&other) noexcept=default
 
sarroperator= (std::initializer_list< T > il)
 
constexpr sarroperator= (const sarr &other)
 
constexpr sarroperator= (sarr &&other) noexcept
 
GAIA_NODISCARD constexpr pointer data () noexcept
 
GAIA_NODISCARD constexpr const_pointer data () const noexcept
 
GAIA_NODISCARD constexpr decltype(autooperator[] (size_type pos) noexcept
 
GAIA_NODISCARD constexpr decltype(autooperator[] (size_type pos) const noexcept
 
GAIA_NODISCARD constexpr size_type size () const noexcept
 
GAIA_NODISCARD constexpr bool empty () const noexcept
 
GAIA_NODISCARD constexpr size_type capacity () const noexcept
 
GAIA_NODISCARD constexpr size_type max_size () const noexcept
 
GAIA_NODISCARD constexpr decltype(autofront () noexcept
 
GAIA_NODISCARD constexpr decltype(autofront () const noexcept
 
GAIA_NODISCARD constexpr decltype(autoback () noexcept
 
GAIA_NODISCARD constexpr decltype(autoback () const noexcept
 
GAIA_NODISCARD constexpr auto begin () noexcept
 
GAIA_NODISCARD constexpr auto begin () const noexcept
 
GAIA_NODISCARD constexpr auto cbegin () const noexcept
 
GAIA_NODISCARD constexpr auto rbegin () noexcept
 
GAIA_NODISCARD constexpr auto rbegin () const noexcept
 
GAIA_NODISCARD constexpr auto crbegin () const noexcept
 
GAIA_NODISCARD constexpr auto end () noexcept
 
GAIA_NODISCARD constexpr auto end () const noexcept
 
GAIA_NODISCARD constexpr auto cend () const noexcept
 
GAIA_NODISCARD constexpr auto rend () noexcept
 
GAIA_NODISCARD constexpr auto rend () const noexcept
 
GAIA_NODISCARD constexpr auto crend () const noexcept
 
GAIA_NODISCARD constexpr bool operator== (const sarr &other) const
 
GAIA_NODISCARD constexpr bool operator!= (const sarr &other) const
 

Public Attributes

m_data [N]
 

Static Public Attributes

static constexpr size_t value_size = sizeof(T)
 
static constexpr size_type extent = N
 

Detailed Description

template<typename T, sarr_detail::size_type N>
class gaia::cnt::sarr< T, N >

Fixed-size stack array with AoS storage. Interface compatiblity with std::array where it matters.

Template Parameters
TElement type stored directly in the array.
NNumber of elements and fixed capacity.
Note
This container can be used in constexpr environment.

Constructor & Destructor Documentation

◆ sarr()

template<typename T , sarr_detail::size_type N>
constexpr gaia::cnt::sarr< T, N >::sarr ( core::zero_t  )
inlineconstexprnoexcept

Explicit value-initialization constructor for call sites that want zero/value initialization to be obvious.

Note
Even though sarr is an aggregate type and we could zero-initialize by doing sarr<int,10> tmp{}, we keep this function around for design compatibility with other containers that are not aggregate types.

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