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 for the latest Boost documentation.


A customisation point that connects a sender to a receiver.

constexpr unspecified connect = unspecified;

The name execution::connect 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::connect(s, r) is expression-equivalent to:

and as_invocable is a class template equivalent to the following:

template<class R>
 struct as_invocable
   R* r_;
   explicit as_invocable(R& r) noexcept
     : r_(std::addressof(r)) {}
   as_invocable(as_invocable && other) noexcept
     : r_(std::exchange(other.r_, nullptr)) {}
   ~as_invocable() {
   void operator()() & noexcept try {
     r_ = nullptr;
   } catch(...) {
     execution::set_error(std::move(*r_), current_exception());
     r_ = nullptr;

Header: boost/asio/execution/connect.hpp

Convenience header: boost/asio/execution.hpp