VLink  2.0.0
A high-performance communication middleware
vlink::Function< SignatureT, SboSizeT > Class Template Reference

Copyable type-erased callable analogue of std::function with a tunable SBO and pool spill. More...

#include <functional.h>

Inheritance diagram for vlink::Function< SignatureT, SboSizeT >:
Collaboration diagram for vlink::Function< SignatureT, SboSizeT >:

Detailed Description

template<typename SignatureT, size_t SboSizeT = 64U>
class vlink::Function< SignatureT, SboSizeT >

Copyable type-erased callable analogue of std::function with a tunable SBO and pool spill.

Holds any copy-constructible target invocable as ReturnT(ArgsT...). Default-instantiated Function uses a 64-byte SBO; Function<Sig, N> picks an arbitrary inline budget. operator() is const (matching std::function 's logical-const convention – the placement-newed target itself is non-const, so the const_cast pattern inside the invoker is well-defined). Empty construction, nullptr-from-nullptr, and the std::bad_function_call empty-call exception all match std::function. Copy operations follow copy-and-swap and provide the strong exception guarantee; move construction, move assignment and swap are noexcept.

Template Parameters
ReturnTResult type of the invocable target.
ArgsTArgument types of the invocable target.
SboSizeTInline storage budget in bytes; must be >= sizeof(void*).

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