title: error: use of deleted function ‘std::thread::thread(const std::thread&)'
body: <p>The code bellow compiles and works as expected.
  The structure (class) <code>A</code> derives from <code>std::thread</code> and expands with an <code>int</code> more.
  The <code>main</code> code creates some threads and afterwards waits them to finish.</p>
  
  <p>The problem is that while the code compiles without a destructor in struct <code>A</code>, when the destructor is <strong>uncommented</strong> ( <code>~A(){}</code> ) I get:</p>
  
  <blockquote>
    <p>error: use of deleted function ‘std::thread::thread(const std::thread&amp;)' </p>
  </blockquote>
  
  <p>and I have no idea on why.</p>
  
  <p>Moreover I don't understand why the code works both with <code>push_back</code> and with <code>emplace_back</code> while according to what I understand it shouldn't work with <code>push_back</code>.</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;thread&gt;
  #include &lt;vector&gt;
  
  struct A : std::thread {
      int i;
      A(void f(const char*),const char* s,int i_) : std::thread{f,s},i{i_}{
          std::cout&lt;&lt;"A created"&lt;&lt;std::endl;
      }
      //~A(){} // uncomment to see error
  };
  
  void dosomething(const char* s){
      std::cout&lt;&lt;s&lt;&lt;std::endl;
  }
  
  int main(){
      std::vector&lt;A&gt; aa;
      aa.emplace_back(&amp;dosomething,"hi people",3434);
      aa.push_back(A(&amp;dosomething,"hi again people",777));
      aa.emplace_back(&amp;dosomething,"hi again people",777);
      aa.push_back(A(&amp;dosomething,"hi again people",777));
  
      for(auto&amp; i:aa) i.join();
  }
  </code></pre>