Template Struct receiver_of¶
Defined in File execution.hpp
Struct Documentation¶
-
template<typename
T, typenameE= std::exception_ptr, typename ...Vs>
structreceiver_of¶ Concept that defines a receiver of a particular kind.
A receiver represents the continuation of an asynchronous operation. An asynchronous operation may complete with a (possibly empty) set of values, an error, or it may be canceled. A receiver has three principal operations corresponding to the three ways an asynchronous operation may complete:
concore::set_value(), concore::set_error(), and concore::set_done(). These are collectively known as a receiver’s completion-signal operations.- Template Parameters
T: The type being checked to see if it’s a bare-bone receiverE: The type of errors that the receiver accepts; defaultstd::exception_ptrVs...: The types of the values accepted by the receiver
The following constraints must hold with respect to receiver’s completion-signal operations:
None of a receiver’s completion-signal operations shall be invoked before concore::start() has been called on the operation state object that was returned by concore::connect() to connect that receiver to a sender.
Once concore::start() has been called on the operation state object, exactly one of the receiver’s completion-signal operations shall complete non-exceptionally before the receiver is destroyed.
If concore::set_value() exits with an exception, it is still valid to call concore::set_error() or concore::set_done() on the receiver.
This concept checks that all three CPOs are defined (as opposed to receiver who only checks set_done() and set_error()).
This is an extension of the receiver concept, but also requiring the set_value() CPO to be present, for a given set of value types.