Include file:

#include "mcrl2/utilities/stack_array.h
class mcrl2::utilities::stack_array

Provides (a subset of) the interface of std::array<T> for a portion of preallocated memory. Can be used to interface with a portion of memory allocated on the stack,.

MCRL2_DECLARE_STACK_ARRAY. The advantage over MCRL2_SPECIFIC_STACK_ALLOCATOR is that the lifetime of the underlying objects is bounded by the lifetime of the stack_array.

Public types

type mcrl2::utilities::stack_array::const_iterator

typedef for const T *

type mcrl2::utilities::stack_array::const_reverse_iterator

typedef for std::reverse_iterator< const_iterator >

type mcrl2::utilities::stack_array::iterator

typedef for T *

type mcrl2::utilities::stack_array::reverse_iterator

typedef for std::reverse_iterator< iterator >

Private attributes

T *mcrl2::utilities::stack_array::m_reserved_memory
std::size_t mcrl2::utilities::stack_array::m_size

Public member functions

iterator begin()
const_iterator begin() const
T *data()
const T *data() const
bool empty() const
iterator end()
const_iterator end() const
std::size_t max_size() const
T &operator[](std::size_t index)
reverse_iterator rbegin()
const_reverse_iterator rbegin() const
reverse_iterator rend()
const_reverse_iterator rend() const
std::size_t size() const
stack_array(T *reserved_memory, std::size_t N)

The given pointer should be able to hold N element of sizeof(T) bytes.