title: Why can't C++11 move a noncopyable functor to a std::function?
body: <pre><code>//------------------------------------------------------------------------------
  struct A
  {
      A(){}
      A(A&amp;&amp;){}
      A&amp; operator=(A&amp;&amp;){return *this;}
      void operator()(){}
  
  private:
      A(const A&amp;);
      A&amp; operator=(const A&amp;);
  
      int x;
  };
  
  //------------------------------------------------------------------------------
  int main()
  {
      A a;
      std::function&lt;void()&gt; func(std::move(a));
  }
  </code></pre>
  
  <p>'A::A' : cannot access private member declared in class 'A'</p>
  
  <p>It seems like when I capture something by reference or <code>const</code> I can make a non-copyable lambda. However when I do that it actually works to give it to a <code>std::function</code>.</p>