title: How to copy the slots of a boost signal
body: <p>Is there a way to get the slots a signal connected to? i.e, i want to copy the slots of a signal from one instance of a class to another</p>
  
  <p>I have a signal in my class and run into the following error. This is probably because this class is used in STL containers.</p>
  
  <pre><code>1&gt;c:\boost_1_52_0\boost\signals\detail\signal_base.hpp(150): error C2248: 'boost::noncopyable_::noncopyable::noncopyable' : cannot access private member declared in class 'boost::noncopyable_::noncopyable'
  1&gt;          c:\boost_1_52_0\boost\noncopyable.hpp(27) : see declaration of 'boost::noncopyable_::noncopyable::noncopyable'
  1&gt;          c:\boost_1_52_0\boost\noncopyable.hpp(22) : see declaration of 'boost::noncopyable_::noncopyable'
  1&gt;          This diagnostic occurred in the compiler generated function 'boost::signals::detail::signal_base::signal_base(const boost::signals::detail::signal_base &amp;)'
  1&gt;  test.cpp
  </code></pre>
  
  <p>so, i decided to put a copy constructor and connect the signal to the slots of the parameter signal and then i get the following error,</p>
  
  <pre><code>1&gt;d:\workarea\boostsignalsEx\test.h(26): error C2663: 'boost::signal1&lt;R,T1&gt;::connect' : 2 overloads have no legal conversion for 'this' pointer
  1&gt;          with
  1&gt;          [
  1&gt;              R=void,
  1&gt;              T1=int
  1&gt;          ]
  </code></pre>
  
  <p>If i remove the const qualifier for the copy constructor parameter, I get another error..</p>
  
  <pre><code>1&gt;d:\workarea\boostsignalsEx\test.h(40): error C2558: class 'test' : no copy constructor available or copy constructor is declared 'explicit'
  </code></pre>
  
  <p>This is the sample code I'm working on</p>
  
  <pre><code>class test{
  public:
  boost::signal1&lt;void, int&gt; sig;
  test(const test&amp; t) { t.sig.connect(sig);}; 
  void attach(boost::function1&lt;void, int&gt; f) {sig.connect(f);}
  };
  </code></pre>
  
  <p>guess chaining the signals will not work because i am not sure if the copy constructor parameter object will out live "this" object</p>