Boost C++ 库

……是世界上最受尊敬、设计最精良的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ Coding Standards

associated_executor - Boost C++ 函数库
PrevUpHomeNext

用于获取与对象关联的执行器的 Traits 类型。

template<
    typename T,
    typename Executor = inline_executor>
struct associated_executor
类型

名称

描述

type

如果 T 具有嵌套类型 executor_type,则为 T::executor_type。否则为 Executor。

成员函数

名称

描述

get [static]

如果 T 具有嵌套类型 executor_type,则返回 t.get_executor()。否则返回 type()。

如果 T 具有嵌套类型 executor_type,则返回 t.get_executor()。否则返回 ex。

如果特化中的 T 模板参数是用户定义的类型,则程序可以特化此 Traits 类型。模板参数 Executor 应为满足 Executor 要求的类型。

特化应满足以下要求,其中 tT 类型对象的 const 引用,eExecutor 类型对象。

  • 提供一个嵌套的 typedef type,它标识一个满足 Executor 要求的类型。
  • 提供一个名为 get 的 noexcept 静态成员函数,该函数可作为 get(t) 调用,并且返回类型为 typetype 的(可能是 const 的)引用。
  • 提供一个名为 get 的 noexcept 静态成员函数,该函数可作为 get(t,e) 调用,并且返回类型为 typetype 的(可能是 const 的)引用。
要求

头文件:boost/asio/associated_executor.hpp

便捷头文件: boost/asio.hpp


PrevUpHomeNext