13 Asynchronous model [async]

13.12 Class template associated_executor [async.assoc.exec]

Class template associated_executor is an associator ([async.reqmts.associator]) for the Executor ([async.reqmts.executor]) type requirements, with default candidate type system_executor and default candidate object system_executor().

namespace std {
namespace experimental {
namespace net {
inline namespace v1 {

  template<class T, class Executor = system_executor>
  struct associated_executor
  {
    using type = see below;

    static type get(const T& t, const Executor& e = Executor()) noexcept;
  };

} // inline namespace v1
} // namespace net
} // namespace experimental
} // namespace std

Specializations of associated_executor shall satisfy the requirements in Table [tab:async.assoc.exec.requirements]. In this table, X is a specialization of associated_executor for the template parameters T and Executor; t is a (possible const) value of T; and e is an object of type Executor.

Table 9associated_executor specialization requirements
ExpressionReturn typeNote
typename X::type A type meeting Executor requirements ([async.reqmts.executor]).
X::get(t) X::type Shall not exit via an exception. Equivalent to X::get(t, Executor()).
X::get(t, e) X::type Shall not exit via an exception.

13.12.1 associated_executor members [async.assoc.exec.members]

using type = see below;

Type: T::executor_type if the qualified-id T::executor_type is valid and denotes a type (C++ 2014 [temp.deduct]). Otherwise Executor.

type get(const T& t, const Executor& e = Executor()) noexcept;

Returns: t.get_executor() if the qualified-id T::executor_type is valid and denotes a type (C++ 2014 [temp.deduct]). Otherwise e.