33 Execution control library [exec]

33.13 Coroutine utilities [exec.coro.util]

33.13.6 execution​::​task [exec.task]

33.13.6.3 task members [task.members]

task(task&& other) noexcept;
Effects: Initializes handle with exchange(other.handle, {}).
~task();
Effects: Equivalent to: if (handle) handle.destroy();
template<class Self, class... Env> static consteval auto get_completion_signatures();
Let the type C be a specialization of execution​::​completion_signatures with the template arguments (in unspecified order):
  • set_value_t() if T is void, and set_value_t(T) otherwise;
  • template arguments of the specialization of execution​::​completion_signatures denoted by error_types; and
  • set_stopped_t().
Returns: C().
template<receiver Rcvr> state<Rcvr> connect(Rcvr&& recv) &&;
Preconditions: bool(handle) is true.
Effects: Equivalent to: return state<Rcvr>(exchange(handle, {}), std::forward<Rcvr>(recv));