Flow is a modern C++ data structure library that provides high-performance allocator-awared containers as an extension to the STL.
-
⚡ Allocator-aware containers
Fully supports custom allocators (default to polymorphic allocators) across all core containers. -
📦 Modular & Lightweight
Minimal dependencies with header only implementation. -
🧠 Custom Memory Resources
Includes arena and monotonic memory resources to improve allocation performance and reduce fragmentation. -
✅ Extensive Unit Testing
Uses GoogleTest to validate correctness and performance across all major components.
Click Here >> API documentation generated by Doxygen.
| Class | Description |
|---|---|
| Container | |
Vector |
A dynamic array container with customizable allocator and growth strategy. Uses PolymorphicAllocator by default. |
BinaryHeap |
A binary min heap container with customizable allocator. Uses PolymorphicAllocator by default. |
DisjointSet |
A disjoint set with path compresssion and union by rank optimization. |
SegmentTree |
A segment tree that supports logarithmic point update and range query. |
NonTypeList |
A compiled-time homogeneous value list. |
| Memory | |
PolymorphicAllocator |
A polymorphic allocator that wraps around a non-owning memory resource. Memory allocation strategy is decided by the memory resource's implementation. |
DebugClass |
Debug class to track copy/move operations. Some operations may be optimized away in release builds. |
| MemoryResource | |
MemoryResource |
An abstract interface used by PolymorphicAllocator. Responsible for raw memory allocation and deallocation. |
DefaultMemoryResource |
A default memory resource that wraps global ::operator new and ::operator delete. |
ArenaMemoryResource |
A linear arena memory resource that allocates memory sequentially from a fixed buffer. Throws std::bad_alloc if there is insufficient space. |
StackMemoryResource |
A stack-based memory resource that allocates memory in a LIFO order. Deallocation must happen in reverse order of allocation. |
PoolMemoryResource |
A pool memory resource that manages fixed-size memory blocks from a pre-allocated buffer. Allocation must meet block size/alignment constraints. |
BuddyMemoryResource |
A buddy-system memory resource that has logarithmic allocation complexity. |
| Concurrency | |
| Container | |
ConcurrentQueue |
A lock-based concurrency-safe FIFO queue. |
ConcurrentFlexQueue |
A fine-grained lock-based concurrency-safe FIFO queue. |
WorkStealingQueue |
A lock-based concurrency-safe FIFO queue that supports stealing job from the back. |
| Thread Pool | |
SimpleThreadPool |
A simple thread pool with a fixed number of worker threads and a shared task queue. |
MultiQueueThreadPool |
A work-stealing multiqueue threadpool. Each worker thread has a thread_local task queue and can steal from each other. |
| Iterator | |
CountedValueViewIterator |
Iterator that returns a constant value a fixed number of times. Useful for creating a virtual range of repeated values without overhead. |
IntegralIterator |
Iterator that iterates through a range of contiguous integers. Useful for creating a virtual range of contiguous values without overhead. |