Boost C++ 库

...是世界上最受推崇和精心设计的 C++ 库项目之一。 Herb SutterAndrei Alexandrescu, C++ 编码标准

PrevUpHomeNext

strand::query

将查询转发到下层执行器。

template<
    typename Property>
constraint_t< can_query< const Executor &, Property >::value, conditional_t< is_convertible< Property, execution::blocking_t >::value, execution::blocking_t, query_result_t< const Executor &, Property > > > query(
    const Property & p) const;

不要直接调用此函数。它旨在与 query 自定义点一起使用。

例如

boost::asio::strand<my_executor_type> ex = ...;
if (boost::asio::query(ex, boost::asio::execution::blocking)
      == boost::asio::execution::blocking.never)
  ...

PrevUpHomeNext