Struct ContainerTemporary

Synopsis

#include <include/EASTL/bonus/ring_buffer.h>

template <typename Container, bool UseHeapTemporary = (sizeof(Container) >= EASTL_MAX_STACK_USAGE)>
struct ContainerTemporary

Description

ContainerTemporary

Helper type which prevents utilizing excessive stack space when creating temporaries when swapping/copying the underlying ring_buffer container type.

Methods

ContainerTemporary
get

Source

Lines 988-999 in include/EASTL/bonus/ring_buffer.h.

template <typename Container, bool UseHeapTemporary = (sizeof(Container) >= EASTL_MAX_STACK_USAGE)>
struct ContainerTemporary
{
    Container mContainer;
    ContainerTemporary(Container& parentContainer)
        : mContainer(Internal::GetFixedContainerCtorAllocator<Container>{}(parentContainer))
    {
    }
    Container& get() { return mContainer; }
};





Add Discussion as Guest

Log in