title: Passing unique_ptr to function object
body: <p>Having problems getting the below to compile. I create a function object and try and pass a unique pointer, but the compiler complains saying I am trying to access private data in unique_ptr. This occurs in msvc 2012 v110.</p>
  
  <pre><code>class Work
  {
  };
  
  class A 
  {
  public:
  
      void doWork(Work w)
      {
          std::cout &lt;&lt; " - - ";
          return;
      }
  
      void doWork2(std::unique_ptr&lt;Work&gt; w)
      {
          std::cout &lt;&lt; " - - ";
          return;
      }
  };
  
  int main()
  {
      A a;
      std::unique_ptr&lt;Work&gt; w2 = std::unique_ptr&lt;Work&gt;(new Work());
  
      Work w;
      auto func = std::bind(&amp;A::doWork, a, std::placeholders::_1);
      auto func2 = std::bind(&amp;A::doWork2, a, std::placeholders::_1);
      func(w);
      func2(std::move(w2));
      return 0;
  }
  </code></pre>