CAF  0.17.3
Related Functions | List of all members
caf::callback< Signature > Class Template Reference

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

#include <callback.hpp>

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)
 Creates a ::callback from the function object fun.
 

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 requires a heap allocation. With the callback implementation of CAF, the object remains on the stack and does not cause more overhead than necessary.


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