Reference

Concepts

Sender Factories

constexpr __read::__read_env_t stdexec::read_env = {}
struct just_from_t : public exec::_just_from<just_from_t>

just_from(fn) creates a sender that completes inline by passing a “sink” function to fn. Calling the sink function with arguments sends the arguments as values to the receiver.

The function passed to just_from must return an instance of a specialization of stdexec::completion_signatures<> that describes the ways the sink function might be invoked. The sink function returns such a specialization of stdexec::completion_signatures<> corresponding to the arguments passed to it, but if your function uses the sink function in several different ways, you must specify the return type explicitly.

Example:
// The following sender is equivalent to just(42, 3.14):
auto sndr = exec::just_from([](auto sink) { return sink(42, 3.14); });
Example:
// A just_from sender can have multiple completion signatures:
auto sndr = exec::just_from(
  [](auto sink) {
    if (some-condition) {
      sink(42);
    } else {
      sink(3.14);
    }
    return stdexec::completion_signatures<stdexec::set_value_t(int),
                                          stdexec::set_value_t(double)>{};
  });

Param fn:

The callable to be invoked when the sender is started.

Post:

The sink function passed to fn must be called exactly once.

constexpr just_from_t exec::just_from = {}

Sender Adaptors

constexpr then_t stdexec::then

The then sender adaptor, which invokes a function with the result of a sender, making the result available to the next receiver.

Sender Consumers

constexpr sync_wait_t stdexec::sync_wait = {}

Utilities