c++ - boost::async - 不确定实现

标签 c++ boost asynchronous future

查看 boost 1.52 中新的 boost::async 实现,我有点不确定它对 launch::deferred 的实现:

else if (int(policy) & int(launch::deferred))
{
  packaged_task<R> pt( boost::forward<F>(f) );

  BOOST_THREAD_FUTURE<R> ret = pt.get_future();
  return ::boost::move(ret);
}

我不太明白这是怎么回事。一旦 packaged_task 被销毁,这不会总是抛出 broken_promise 异常吗?

最佳答案

关于c++ - boost::async - 不确定实现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13327141/

相关文章:

c++ - C++ 中的未知错误消息 C2440

c++ - "spamming"boost::property_tree::read_json 时发生访问冲突

c++ - c++中的模板类和friend关键字(具体例子引用boost::multi_index)

JavaScript:Promise.All() 和 Async/Await 以及 Map()

c# - 阻塞的线程占用了哪些资源

javascript - 使用新的谷歌异步分析片段实现“silktide cookie 同意”

C++ 继承 : confused with base member access from derived object

c++ - 我可以有模板实例化副作用吗?

c++ - 附加两个数组的最快方法(连接两个数组)C++

c++ - boost 空 std::forward_list 的序列化