title: why async() write on temporary variable and no crash happend
body: <p>This is some code I write to test async() wirte on tempory variables.
  the function test use async() the execute a function write_A(A* a), and use future.wait_for() to wait the result for a period of time. If it'is timeout, test returns, the A a2 will be freeed at the same time, because it is allocated on stack. The write_A write on A* a would crash. But in fact the program works fine. Why the async executed function write_A can write on freed stack tempory variable?</p>
  
  <pre><code>struct A {
    string name;
    string address;
  };
  
  int write_A(A* a) {
    sleep(3);
    a-&gt;name = "tractor";
    a-&gt;address = "unknow";
    cout &lt;&lt;"write_A return" &lt;&lt; endl;
    return 0;
  }
  
  void test(A* a) {
     A a2;
    future&lt;int&gt; fut = async(launch::async, write_A, &amp;a2);
    auto status = fut.wait_for(chrono::milliseconds(1000));
    if (status == future_status::ready) {
      int ret = fut.get();
      *a = a2;
      cout &lt;&lt;"succ"&lt;&lt;endl;
    } else {
      cout &lt;&lt;"timeout"&lt;&lt;endl;
    }
  }
  
  void test2() {
    A a;
    test(&amp;a);
  }
  
  int main ()
  {
    test2();
    sleep(5);
    return 0;
  }
  </code></pre>
  
  <p>I expect the program will crash because write_A write on a pointer of object which has beed released when the test returned. But the program output:</p>
  
  <p>timeout</p>
  
  <p>write_A return</p>