title: How to check if a std::async task is finished?
body: <p>In my graphics application I want to generate a batch meshes in another thread. Therefore I asynchrony call the member function using <code>std::async</code>.</p>
  
  <pre><code>task = async(launch::async, &amp;Class::Meshing, this, Data(...));
  </code></pre>
  
  <p>In my update loop I try to check if the thread is ready. If yes, I will send the mesh to the video card and start the next thread. If not, I will skip these operations.</p>
  
  <pre><code>#include &lt;future&gt;
  using namespace std;
  
  class Class
  {
  public:
      void Update()
      {
          if(task.finished()) // this method does not exist
          {
              Data data = task.get();
              // ...
              task = async(launch::async, &amp;Class::Meshing, this, Data(/* ... */));
          }
      }
  
  private:
      struct Data
      {
          // ...
      };
      future&lt;Data&gt; task;
      Data Meshing(Data data)
      {
          // ...
      }
  };
  </code></pre>
  
  <p>How can I check if the asynchrony thread finished without stucking in the update function?</p>