title: Is there a way to use boost signals and slots with non-copyable objects?
body: <p>I would like to pass a non-copyable object to a boost signal. See the code below (doesn't compile). Is there a possible workaround?</p>
  
  <pre><code>#include &lt;boost/signals2.hpp&gt;
  #include &lt;iostream&gt;
  #include &lt;memory&gt;
  
  struct MySlot
  {
    void operator()(std::unique_ptr&lt;int&gt;&amp;&amp; input) const
    {
      std::cout &lt;&lt; "Signaled " &lt;&lt; *input.get();
    }
  };
  
  int main(int argc, char* argv[])
  {
    boost::signals2::signal&lt;void(std::unique_ptr&lt;int&gt;)&gt; signal;
  
    signal.connect(MySlot());
  
    auto ptr = std::make_unique&lt;int&gt;(20);
    signal(std::move(ptr));
  }
  </code></pre>