title: Return a value from a thread in C++11
body: <p>What's the <strong>most efficient</strong> way to return a value from a thread in C++11?</p>
  
  <pre><code>vector&lt;thread&gt; t(6);
  
  for(int i = 0; i &lt; 6; i++)
      t[i] = thread(do_c);
  
  for(thread&amp; t_now : t)
      t_now.join();
  
  for(int i = 0; i &lt; 6; i++)
      cout &lt;&lt; /*the return of function do_c*/
  </code></pre>
  
  <p>Also, if the change will benefit performance, feel free to recommend another thread than <code>std::thread</code>.</p>