Boost C++ 库

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

associated_immediate_executor - Boost C++ 函数库
PrevUpHomeNext

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

template<
    typename T,
    typename Executor>
struct associated_immediate_executor
类型

名称

描述

type

如果 T 具有嵌套类型 immediate_executor_type,.

成员函数

名称

描述

get [static]

如果 T 具有嵌套类型 immediate_executor_type,则返回 t.get_immediate_executor()。否则返回 boost::asio::require(ex, boost::asio::execution::blocking.never)。

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

特化应满足以下要求,其中 t 是类型 T 的对象的 const 引用,e 是类型 Executor 的对象。

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

头文件: boost/asio/associated_immediate_executor.hpp

便捷头文件: boost/asio.hpp


PrevUpHomeNext