/* Twiddles to pass const pointers across the language barrier * * see: http://language-binding.net/pyplusplus/troubleshooting_guide/shared_ptr/shared_ptr.html */ namespace boost{ template inline T* get_pointer( boost::shared_ptr const& p ){ return const_cast< T* >( p.get() ); } } namespace boost{ namespace python{ template struct pointee< boost::shared_ptr >{ typedef T type; }; } } //boost::python namespace utils{ template< class T > void register_const_ptr(){ namespace bpl = boost::python; // bpl::register_ptr_to_python< boost::shared_ptr< T > >(); bpl::register_ptr_to_python< boost::shared_ptr< const T > >(); bpl::implicitly_convertible< boost::shared_ptr< T >, boost::shared_ptr< const T > >(); // bpl::implicitly_convertible< boost::shared_ptr< const T >, boost::shared_ptr< T > >(); } }