title: boost::thread and std::unique_ptr
body: <p>Is it somehow possible to pass an std::unique_ptr as a parameter to a boost::thread constructor? If not, what is the best workaround?</p>
  
  <p>A small example:</p>
  
  <pre><code>// errors: g++ uniqueptr_thread.cpp -std=c++0x
  
  #include &lt;iostream&gt;
  #include &lt;memory&gt;
  #include &lt;boost/thread.hpp&gt;
  
  class TestThread{
  public:
    void operator()(std::unique_ptr&lt;int&gt; val){
      std::cout &lt;&lt; "parameter: " &lt;&lt; val &lt;&lt; std::endl;
    }
  
  };
  
  int main(int argc, char* argv[]){
  
    std::unique_ptr&lt;int&gt; ptr(new int(5));
  
    boost::thread th( new TestThread(), std::move(ptr));
  
  }
  </code></pre>