title: why does detach thread get no output message?
body: <p>I am testing a cpp code as below, and got one very confusing phenomena, below code does not print "label" string. Could anyone explain it? really thanks for your help!</p>
  
  <pre><code>class Data {
  public:
    Data() { std::cout &lt;&lt; __FUNCTION__ &lt;&lt; std::endl; }
    ~Data() { std::cout &lt;&lt; __FUNCTION__ &lt;&lt; std::endl; }
    void show() { std::cout &lt;&lt; label &lt;&lt; std::endl; }
  
  private:
    std::string label{"label"};
  };
  
  int main() {
    auto data = std::make_shared&lt;Data&gt;();
    std::thread t([=]() mutable{
      data-&gt;show();
    });
  
    t.detach();
  }
  </code></pre>