Template Struct as_receiver

Struct Documentation

template<typename F>
struct concore::v1::as_receiver

Wrapper that transforms a functor into a receiver.

This will implement the operations specific to a receiver given a functor. The receiver will call the functor whenever

set_value() is called. It will not do anything on set_done() and it will terminate the program if set_error() is called.
Template Parameters
  • F: The type of the functor

This types models the receiver_of<> concept

See

receiver_of, set_value(), set_done(), set_error()

Public Functions

as_receiver(F &&f) noexcept

Constructor.

void set_value() noexcept(noexcept(f_()))

Called whenever the sender completed the work with success.

void set_done() noexcept

Called whenever the work was canceled.

template<typename E>
void set_error(E) noexcept

Called whenever there was an error while performing the work in the sender.