A C++ template library for embedded applications
Designed and maintained by
Aster Consulting Ltd

Memory

These functions will create objects in uninitialised memory.
POD types will be default or value initialised, Non-trivial types by calling placement new.

Address

template <typename T>
T* addressof(T& t)
Returns the address of an object.

Create / Destroy

Functions that create or destroy items in uninitialised memory.

template <typename T>
void create_default_at(T* p)

template <typename T, typename TCounter>
void create_default_at(T* p, Tcounter count)
Creates a default value. For POD types this will be undefined.
The second version is supplied a counter, which will be incremented.

template <typename T>
void create_value_at(T* p)

template <typename T, typename TCounter>
void create_value_at(T* p, Tcounter count)
Creates a default value by constructing the  item with T().
The second version is supplied a counter, which will be incremented.

template <typename T>
void create_copy_at(T* p)

template <typename T, typename TCounter>
void create_copy_at(T* p, const T& value, Tcounter count)
Creates a default value by constructing the  item with T(value).
The second version is supplied a counter, which will be incremented.

template <typename T>
void destroy_at(T* p)

template <typename T, typename TCounter>
void destroy_at(T* p, TCounter& count)
Calls the destructor for non-pod types.
The second version is supplied a counter, which will be decremented.

template <typename T, typename TSize >
void destroy_n(T* p, TSize n)

template <typename T, typename TSize, typename TCounter>
void destroy_n(T* p, TSize n, TCounter& count)
Calls the destructor for a range of non-pod types, starting at address p.
The second version is supplied a counter, which will be decremented by the number of items destructed.

template <typename T>
void destroy(T* p, T* p_end)

template <typename T, typename TCounter>
void destroy(T* p, T* p_end TCounter& count)
Calls the destructor for a range of non-pod types, starting at address p.
The second version is supplied a counter, which will be decremented by the number of items destructed.

uninitialzed_fill

template <typename TIterator, typename TSize, typename T>
TIterator uninitialized_fill_n(TIterator o_begin, TSize count, const T& value)

template <typename TIterator, typename TSize, typename T>
TIterator uninitialized_fill_n(TIterator o_begin, TSize count, const T& value, etl::debug_count)

Fills uninitialised memory with N values.

template <typename TIterator, typename T>
TIterator uninitialized_fill(TIterator o_begin, TIterator o_end, const T& value)

template <typename TIterator, typename TSize, typename T>
TIterator uninitialized_fill_n(TIterator o_begin, TSize count, const T& value, etl::debug_count)

Fills uninitialised memory range with a value.

uninitialised_copy

template <typename TInputIterator, typename TSize, typename TOutputIterator>
TIterator uninitialized_copy_n(TInputIterator i_begin, TSize count, TOutputIterator o_begin)

template <typename TInputIterator, typename TSize, typename TOutputIterator>
TIterator uninitialized_copy_n(TInputIterator i_begin, TSize count, TOutputIterator o_begin,
etl::debug_count)

Copies N objects to uninitialised memory.

template <typename TInputIterator, typename TOutputIterator>
TIterator uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin)

template <typename TInputIterator, typename TOutputIterator>
TIterator uninitialized_copy(TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin,
etl::debug_count)

Copies a range of objects to uninitialised memory.

uninitialized_default_construct

template <typename TOutputIterator>
void uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end)

template <typename TOutputIterator, typename TCounter>
void uninitialized_default_construct(TOutputIterator o_begin, TOutputIterator o_end, TCounter& count)

template <typename TOutputIterator, typename TSize>
TOutputIterator uninitialized_default_construct_n(TOutputIterator o_begin, TSize n)

template <typename TOutputIterator, typename TSize, typename TCounter>
TOutputIterator uninitialized_default_construct_n(TOutputIterator o_begin, TSize n, TCounter& count)

Creates default values. For POD types this will be undefined.

uninitialized_value_construct

template <typename TOutputIterator>
void uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end)

template <typename TOutputIterator, typename TCounter>
void uninitialized_value_construct(TOutputIterator o_begin, TOutputIterator o_end, TCounter& count)

template <typename TOutputIterator, typename TSize>
TOutputIterator uninitialized_value_construct_n(TOutputIterator o_begin, TSize n)

template <typename TOutputIterator, typename TSize, typename TCounter>
TOutputIterator uninitialized_value_construct_n(TOutputIterator o_begin, TSize n, TCounter& count)

Creates values constructed with T().
memory.h