Loading...
Searching...
No Matches
caf::callback< Ts > Class Template Referenceabstract

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

`#include <callback.hpp>`

## Public Member Functions

virtual error | operator() (Ts...)=0

## Related Symbols

(Note that these are not member symbols.)
template<class F>
select_callback< F >::type | make_callback (F fun)
| Creates a callback from a lambda expression.

## Detailed Description

template<class... Ts>
class caf::callback< Ts >

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:

- /build/actor-framework-Z9pIPl/actor-framework-0.17.6/libcaf_core/caf/callback.hpp