boost python return same instance with make_constructor
问题 I'm trying to make so this code returns the same instance in both the init function and the callback function test1.py import test1 c = test1.C() print 'init:', c def func(c): print 'func:', c test1.register_callback(func) test1.cpp #include <iostream> #include <vector> #include <boost/python.hpp> using namespace boost::python; class C; std::vector<boost::shared_ptr<C>> v; class C : public boost::noncopyable { public: C() { std::cout << "C()" << std::endl; } ~C() { std::cout << "~C()" << std: