title: std::future::get() does not catch the exception when the async function throws and program crashes
body: <p>I am trying to call the <code>future::get()</code> function from the function started using the <code>std::async</code> function. In the <code>async</code> function I am throwing so that I can catch the exception in the <code>future::get()</code> call. However, I get an exception in the <code>get()</code> call that is not caught in the catch bloc and the program crashes with unhandeld exception. What am I missing ?</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;future&gt;
  
  void AsyncMethodThrowsExceptionTest();
  void AsyncMethodThrowsException();
  
  using namespace std;
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      AsyncMethodThrowsExceptionTest();
      return 0;
  }
  
  
  void AsyncMethodThrowsExceptionTest()
  {
  
      std::future&lt;int&gt; executionFuture;
  
      try
      {
          executionFuture = async(launch::async, AsyncMethodThrowsException);
      }
      catch(...)
      {
          cout &lt;&lt; "caught ex [1]";
      }
  
      std::future_status::future_status status;
  
      status = executionFuture.wait_for(std::chrono::milliseconds(500u));
      if(status == std::future_status::deferred)
      {
          cout &lt;&lt; "AsyncMethodThrowsException has not started";
      }
      else if(status == std::future_status::timeout)
      {
          cout &lt;&lt; "AsyncMethodThrowsException timed out";
      }
      else if(status == std::future_status::ready)
      {
          cout &lt;&lt; "AsyncMethodThrowsException successfully completed";
          try
          {
              if(executionFuture.valid())
              {
                  executionFuture.get();
              }
          }
          catch(const std::future_error&amp; ex)
          {
              cout &lt;&lt; "AsyncMethodThrowsExceptionTest catch block";
          }
      }
  }
  
  void AsyncMethodThrowsException()
  {
      throw(new exception("Exception from AsyncMethodThrowsException"));
  }
  </code></pre>