title: boost python return same instance with make_constructor
body: <p>I'm trying to make so this code returns the same instance in both the init function and the callback function</p>
  
  <h1>test1.py</h1>
  
  <pre><code>import test1
  
  c = test1.C()
  print 'init:', c
  
  def func(c):
      print 'func:', c
  
  test1.register_callback(func)
  </code></pre>
  
  <h1>test1.cpp</h1>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  
  #include &lt;boost/python.hpp&gt;
  
  using namespace boost::python;
  
  class C;
  std::vector&lt;boost::shared_ptr&lt;C&gt;&gt; v;
  
  class C
  : public boost::noncopyable
  {
  public:
      C() {
          std::cout &lt;&lt; "C()" &lt;&lt; std::endl;
      }
  
      ~C() {
          std::cout &lt;&lt; "~C()" &lt;&lt; std::endl;
      }
  };
  
  boost::shared_ptr&lt;C&gt; create() {
      C *c = new C();
      auto ptr = boost::shared_ptr&lt;C&gt;(c);
      v.push_back(ptr);
      return ptr;
  }
  
  void register_callback(object func) {
      func(v[0]);
  }
  
  BOOST_PYTHON_MODULE(test1)
  {
      class_&lt;C, boost::shared_ptr&lt;C&gt;, boost::noncopyable&gt;("C", no_init)
          .def("__init__", make_constructor(&amp;create))
      ;
  
      def("register_callback", register_callback);
  }
  </code></pre>
  
  <p>The output I get now is:</p>
  
  <pre><code>init: &lt;test1.C object at 0x7f62181bd5d0&gt;
  func: &lt;test1.C object at 0x7f62181c1848&gt;
  </code></pre>
  
  <p>And what I'm trying to get is:</p>
  
  <pre><code>init: &lt;test1.C object at 0x7f62181bd5d0&gt;
  func: &lt;test1.C object at 0x7f62181bd5d0&gt;
  </code></pre>
  
  <p>is this possible and how?</p>