Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
UninitialisedStorage< T, cnt > Class Template Reference

#include "lib/uninitialised-storage.hpp"

Description

template<typename T, size_t cnt = 1>
class lib::UninitialisedStorage< T, cnt >

Block of raw uninitialised storage with array like access.

Template Parameters
Tthe nominal type assumed to sit in each »slot«
cntnumber of »slots« in the array

Definition at line 79 of file uninitialised-storage.hpp.

Static Public Member Functions

static constexpr size_t size ()
 

Public Member Functions

_Arrarray ()
 
_Arr const & array () const
 
 operator _Arr & ()
 
 operator _Arr const & () const
 
T & operator[] (size_t idx)
 
T const & operator[] (size_t idx) const
 
template<typename... Args>
T & createAt (size_t idx, Args &&...args)
 
void destroyAt (size_t idx)
 

Private Types

using _Arr = std::array< T, cnt >
 

Private Attributes

std::byte buffer_ [sizeof(_Arr)]
 

Member Typedef Documentation

◆ _Arr

template<typename T , size_t cnt = 1>
using _Arr = std::array<T,cnt>
private

Definition at line 81 of file uninitialised-storage.hpp.

Member Function Documentation

◆ array() [1/2]

template<typename T , size_t cnt = 1>
_Arr & array ( )
inline

Definition at line 86 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::buffer_.

Referenced by UninitialisedStorage< T, cnt >::operator _Arr &(), UninitialisedStorage< T, cnt >::operator _Arr const &(), UninitialisedStorage< T, cnt >::operator[](), and UninitialisedStorage< T, cnt >::operator[]().

+ Here is the caller graph for this function:

◆ array() [2/2]

template<typename T , size_t cnt = 1>
_Arr const & array ( ) const
inline

Definition at line 92 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::buffer_.

◆ operator _Arr &()

template<typename T , size_t cnt = 1>
operator _Arr & ( )
inline

Definition at line 98 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::array().

+ Here is the call graph for this function:

◆ operator _Arr const &()

template<typename T , size_t cnt = 1>
operator _Arr const & ( ) const
inline

Definition at line 99 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::array().

+ Here is the call graph for this function:

◆ operator[]() [1/2]

template<typename T , size_t cnt = 1>
T & operator[] ( size_t  idx)
inline

Definition at line 101 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::array().

Referenced by UninitialisedStorage< T, cnt >::createAt(), and UninitialisedStorage< T, cnt >::destroyAt().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator[]() [2/2]

template<typename T , size_t cnt = 1>
T const & operator[] ( size_t  idx) const
inline

Definition at line 102 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::array().

+ Here is the call graph for this function:

◆ createAt()

template<typename T , size_t cnt = 1>
template<typename... Args>
T & createAt ( size_t  idx,
Args &&...  args 
)
inline

Definition at line 107 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::operator[]().

+ Here is the call graph for this function:

◆ destroyAt()

template<typename T , size_t cnt = 1>
void destroyAt ( size_t  idx)
inline

Definition at line 113 of file uninitialised-storage.hpp.

References UninitialisedStorage< T, cnt >::operator[]().

+ Here is the call graph for this function:

◆ size()

template<typename T , size_t cnt = 1>
static constexpr size_t size ( )
inlinestaticconstexpr

Definition at line 118 of file uninitialised-storage.hpp.

Member Data Documentation

◆ buffer_

template<typename T , size_t cnt = 1>
std::byte buffer_[sizeof(_Arr)]
private
+ Inheritance diagram for UninitialisedStorage< T, cnt >:
+ Collaboration diagram for UninitialisedStorage< T, cnt >:

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