#include <callback.hh>
Public Member Functions | |
Callback (std::function< void(std::future< T >)> fun) | |
Callback (Callback &&callback) noexcept(std::is_nothrow_move_constructible_v< decltype(fun)>) | |
void | operator() (T &&t) noexcept |
void | rethrow (const std::exception_ptr &exc=std::current_exception()) noexcept |
A callback is a wrapper around a lambda that accepts a valid of type T or an exception. (We abuse std::future<T> to pass the value or exception.)