C++ Actor Framework 0.18
Loading...
Searching...
No Matches
Related Functions | List of all members
caf::callback< Signature > Class Template Reference

Describes a simple callback, usually implemented via lambda expression. More...

Inherited by caf::callback_impl< F, Result(Ts...)>.

Related Functions

(Note that these are not member functions.)

template<class F >
auto make_callback (F fun)
 Wraps fun into a callback function object.
 
template<class F >
auto make_type_erased_callback (F fun)
 Creates a heap-allocated, type-erased callback from the function object fun.
 
template<class F >
auto make_shared_type_erased_callback (F fun)
 Creates a heap-allocated, type-erased callback from the function object fun with shared ownership.
 

Detailed Description

template<class Signature>
class caf::callback< Signature >

Describes a simple callback, usually implemented via lambda expression.

Callbacks are used as "type-safe function objects" wherever an interface requires dynamic dispatching. The alternative would be to store the lambda in a std::function, which adds another layer of indirection and always requires a heap allocation. With the callback implementation of CAF, the object may remains on the stack and do not cause more overhead than necessary.


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