[C++-sig] copy constructors and multiple instances

Hans Meine hans_meine at gmx.net
Fri Sep 2 10:24:17 CEST 2011


Am Freitag, 2. September 2011, 04:31:24 schrieb Josh Stratton:
> BOOST_PYTHON_MODULE(scene)
> {
>     class_<Scene, boost::noncopyable>("Scene");
> }
> 
> // later calling this
> boost::python::register_ptr_to_python< boost::shared_ptr<Scene> >();
> PyImport_AppendInittab("scene", &initscene);
> 
> So is this all I really need for the mapping then?

register_ptr_to_python deals with the boost::shared_ptr around a Scene, but of 
course you still need a converter for the latter, e.g. as registered by using 
class_ to describe your class.

HTH
  Hans


More information about the Cplusplus-sig mailing list