Boost C++ Libraries of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.


A customisation point that submits a sender to a receiver.

constexpr unspecified submit = unspecified;

The name execution::submit denotes a customisation point object. For some subexpressions s and r, let S be a type such that decltype((s)) is S and let R be a type such that decltype((r)) is R. The expression execution::submit(s, r) is ill-formed if sender_to<S, R> is not true. Otherwise, it is expression-equivalent to:

template<class S, class R>
  struct submit_receiver {
    struct wrap {
      submit_receiver * p_;
        requires receiver_of<R, As...>
      void set_value(As&&... as) &&
        noexcept(is_nothrow_receiver_of_v<R, As...>) {
        execution::set_value(std::move(p_->r_), (As&&) as...);
        delete p_;
      template<class E>
        requires receiver<R, E>
      void set_error(E&& e) && noexcept {
        execution::set_error(std::move(p_->r_), (E&&) e);
        delete p_;
      void set_done() && noexcept {
        delete p_;
    remove_cvref_t<R> r_;
    connect_result_t<S, wrap> state_;
    submit_receiver(S&& s, R&& r)
      : r_((R&&) r)
      , state_(execution::connect((S&&) s, wrap{this})) {}

Header: boost/asio/execution/submit.hpp

Convenience header: boost/asio/execution.hpp