REAL
Regular Expression Algorithmic Library — constexpr C++20 regex
Loading...
Searching...
No Matches
real::detail::small_vec< T, InlineCapacity >::Storage Union Reference
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
 
Storageoperator= (const Storage &)=delete
 
 Storage (Storage &&)=delete
 
Storageoperator= (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

Definition at line 252 of file storage.hpp.

Constructor & Destructor Documentation

◆ Storage() [1/3]

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

Starts in the inline state.

At run time the inline buffer is left UNINITIALIZED: small_vec writes every element through std::construct_at (placement-new) before any read (push_back and assign), so the value-init was pure overhead — ~30 % of the instruction count on a findall tokenizing workload (a fresh slot buffer per match, of which ~2 slots serve). At compile time the member must be active and initialized for the constexpr matching path (which assigns through inline_data), so it is value-initialized there via construct_at on the whole inline_block — activating a class-type member is what a constexpr union allows (an element-wise or bare C-array activation is not).

Definition at line 267 of file storage.hpp.

◆ ~Storage()

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

Destruction handled by cleanup.

Definition at line 274 of file storage.hpp.

◆ Storage() [2/3]

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

◆ Storage() [3/3]

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

Member Function Documentation

◆ operator=() [1/2]

template<typename T , std::size_t InlineCapacity>
Storage & real::detail::small_vec< T, InlineCapacity >::Storage::operator= ( const Storage )
delete

◆ operator=() [2/2]

template<typename T , std::size_t InlineCapacity>
Storage & real::detail::small_vec< T, InlineCapacity >::Storage::operator= ( Storage &&  )
delete

Member Data Documentation

◆ heap_ptr

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

Heap storage (when is_heap_).

Definition at line 255 of file storage.hpp.

◆ inline_buffer

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

Inline storage (when not heap).

Definition at line 254 of file storage.hpp.


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