<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>faith_and_brave</author_name>
  <author_url>https://blog.hatena.ne.jp/faith_and_brave/</author_url>
  <blog_title>Faith and Brave - C++で遊ぼう</blog_title>
  <blog_url>https://faithandbrave.hateblo.jp/</blog_url>
  <categories>
    <anon>C++</anon>
  </categories>
  <description>C++11のドラフト段階では、std::futureにis_ready()というメンバ関数がありました。これは、非同期実行している関数の結果が設定され、値を取り出す準備ができたかどうかを判定する機能です。 C++11が正式に制定された段階では、インタフェースの複雑さ回避のため、is_ready()メンバ関数が削除されてしまいましたが、ここでその機能が必要なケースを挙げてみようと思います。 ここでは、ゲームループのような定期実行される処理の中で、別スレッドで計算を走らせるのにfutureを使用しています。 future::get()は値の準備ができるまでブロッキングしてしまうので、短い時間で定期…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffaithandbrave.hateblo.jp%2Fentry%2F20121002%2F1349162287&quot; title=&quot; future::is_ready()がほしいケース - Faith and Brave - C++で遊ぼう&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2012-10-02 16:18:07</published>
  <title> future::is_ready()がほしいケース</title>
  <type>rich</type>
  <url>https://faithandbrave.hateblo.jp/entry/20121002/1349162287</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
