REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::small_vec< T, InlineCapacity >::Storage Union Reference

The either-or storage: the inline buffer, or a pointer to the heap block once the vector has spilled. is_heap_ says which member is active. More...

Collaboration diagram for real::detail::small_vec< T, InlineCapacity >::Storage:
[legend]

Public Member Functions

constexpr Storage () noexcept
 Starts in the inline state.
 
constexpr ~Storage ()
 Destruction handled by cleanup.
 
 Storage (const Storage &)=delete
 
Storage & operator= (const Storage &)=delete
 
 Storage (Storage &&)=delete
 
Storage & operator= (Storage &&)=delete
 

Public Attributes

inline_block inline_buffer
 Inline storage (when not heap).
 
T * heap_ptr
 Heap storage (when is_heap_).
 

Detailed Description

template<typename T, std::size_t InlineCapacity>
union real::detail::small_vec< T, InlineCapacity >::Storage

The either-or storage: the inline buffer, or a pointer to the heap block once the vector has spilled. is_heap_ says which member is active.

Constructor & Destructor Documentation

◆ Storage()

template<typename T , std::size_t InlineCapacity>
constexpr real::detail::small_vec< T, InlineCapacity >::Storage::Storage ( )
inlineconstexprnoexcept

Starts in the inline state.

Run time leaves the inline buffer uninitialized (see the class warning). Constant evaluation activates the whole inline_block (a constexpr union can activate a class-type member, not a bare C array); adopt_heap and revert_to_inline switch the active member.


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