libcoro  1.0
Coroutine support library for C++20
coro::function< Prototype, reserved_space > Class Template Reference

Move only function wrapper with small object optimization. More...

Detailed Description

template<typename Prototype, unsigned int reserved_space = 4*sizeof(void *)>
class coro::function< Prototype, reserved_space >

Move only function wrapper with small object optimization.

Template Parameters
PrototypeSpecify prototype as RetVal<Args> or RetVal<Args> noexcept
reserved_spacespace reserved for small function. Default value is 4x voidptr. So a function which fits to this space is constructed directly inside of the object. It also means, that any move operation is performed directly with the closure. Larger functions are allocated on the heap and only pointers are moved.
using MyFunction = concurrency::function<int(std::string) noexcept, 100>;

Definition at line 23 of file function.h.


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