title: Why does passing object reference arguments to thread function fails to compile?
body: <p>I've come to a problem using the new c++11 <code>std::thread</code> interface.<br>
  I can't figure out how to pass a reference to a <code>std::ostream</code> to the function that the thread will execute.</p>
  
  <p>Here's an example with passing an integer(compile and work as expected under gcc 4.6) :  </p>
  
  <pre><code>void foo(int &amp;i) {
      /** do something with i **/
      std::cout &lt;&lt; i &lt;&lt; std::endl;
  }
  
  int k = 10;
  std::thread t(foo, k);
  </code></pre>
  
  <p>But when I try passing an ostream it does not compile :</p>
  
  <pre><code>void foo(std::ostream &amp;os) {
      /** do something with os **/
      os &lt;&lt; "This should be printed to os" &lt;&lt; std::endl;
  }
  
  std::thread t(foo, std::cout);
  </code></pre>
  
  <p>Is there a way to do just that, or is it not possible at all ??</p>
  
  <p>NB: from the compile error it seems to come from a deleted constructor...</p>