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 const_iterator

typedef for const T *

type const_reverse_iterator

typedef for std::reverse_iterator< const_iterator >

type iterator

typedef for T *

type reverse_iterator

typedef for std::reverse_iterator< iterator >

Private attributes

T *m_reserved_memory
std::size_t 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.