Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::FixedFunction< Signature, StorageSize > Class Template Reference

Type-erased callable wrapper with small buffer optimization (SBO). More...

#include <FixedFunction.h>

Detailed Description

template<typename Signature, usize StorageSize = 64>
class Raven::FixedFunction< Signature, StorageSize >

Type-erased callable wrapper with small buffer optimization (SBO).

Template Parameters
SignatureThe function signature, e.g. void(int, float).
StorageSizeInline storage size in bytes (default 64).

Stores and invokes any callable matching the given signature. If the callable fits into inline storage (StorageSize) and meets alignment requirements, it is constructed in-place. Otherwise, a pointer to a heap-allocated callable is stored.

Designed as a move-only replacement for std::function in performance critical contexts (e.g., events, callbacks in Raven).


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