VLink  2.0.0
A high-performance communication middleware
vlink::Function< SignatureT, SboSizeT > 模板类 参考

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

#include <functional.h>

类 vlink::Function< SignatureT, SboSizeT > 继承关系图:
vlink::Function< SignatureT, SboSizeT > 的协作图:

详细描述

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.

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

该类的文档由以下文件生成: