dispenso 1.5.1
A library for task parallelism
Loading...
Searching...
No Matches
small_vector.h File Reference
#include <cassert>
#include <cstddef>
#include <initializer_list>
#include <new>
#include <utility>

Go to the source code of this file.

Classes

class  dispenso::SmallVector< T, N >
 

Detailed Description

A vector-like container with inline storage for small sizes.

SmallVector stores up to N elements inline (on the stack), falling back to heap allocation when size exceeds N. Uses the high bit of the size field to track storage mode, keeping the struct compact with no extra flags.

Once transitioned to heap storage, the vector stays on heap until clear() is called. This ensures reserve() guarantees are honored and avoids unnecessary copies between storage modes.

Definition in file small_vector.h.