diff --git a/doc/v2/operators.html b/doc/v2/operators.html index 231ddf01..10e566ec 100755 --- a/doc/v2/operators.html +++ b/doc/v2/operators.html @@ -214,6 +214,9 @@ namespace boost { namespace python { namespace self_ns { operator_<unspecified> str(self_t); + operator_<unspecified> repr(self_t); + }}}; The tables below describe the methods generated when the results of the @@ -765,6 +768,15 @@ namespace boost { namespace python { namespace self_ns { lexical_cast<std::string>(x) + + + repr + + __repr__ + + lexical_cast<std::string>(x) +

Class Template other

diff --git a/include/boost/python/converter/registrations.hpp b/include/boost/python/converter/registrations.hpp index d71401de..0f335f95 100644 --- a/include/boost/python/converter/registrations.hpp +++ b/include/boost/python/converter/registrations.hpp @@ -34,6 +34,7 @@ struct BOOST_PYTHON_DECL registration { public: // member functions explicit registration(type_info target, bool is_shared_ptr = false); + ~registration(); // Convert the appropriately-typed data to Python PyObject* to_python(void const volatile*) const; diff --git a/include/boost/python/object/pointer_holder.hpp b/include/boost/python/object/pointer_holder.hpp index 569c9d4e..7fad2a25 100644 --- a/include/boost/python/object/pointer_holder.hpp +++ b/include/boost/python/object/pointer_holder.hpp @@ -179,7 +179,7 @@ void* pointer_holder_back_reference::holds(type_info dst_t, bool BOOST_PP_REPEAT_1ST(N, BOOST_PYTHON_UNFORWARD_LOCAL, nil) )) { - python::detail::initialize_wrapper(self, &*this->m_p); + python::detail::initialize_wrapper(self, get_pointer(this->m_p)); } # undef N diff --git a/include/boost/python/operators.hpp b/include/boost/python/operators.hpp index d10a0094..89fe4099 100644 --- a/include/boost/python/operators.hpp +++ b/include/boost/python/operators.hpp @@ -339,6 +339,7 @@ BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_) BOOST_PYTHON_UNARY_OPERATOR(float, double, float_) BOOST_PYTHON_UNARY_OPERATOR(complex, std::complex, complex_) BOOST_PYTHON_UNARY_OPERATOR(str, lexical_cast, str) +BOOST_PYTHON_UNARY_OPERATOR(repr, lexical_cast, repr) # undef BOOST_PYTHON_UNARY_OPERATOR }} // namespace boost::python @@ -350,6 +351,7 @@ using boost::python::self_ns::long_; using boost::python::self_ns::float_; using boost::python::self_ns::complex_; using boost::python::self_ns::str; +using boost::python::self_ns::repr; using boost::python::self_ns::pow; # endif diff --git a/src/converter/registry.cpp b/src/converter/registry.cpp index 50da37d5..179111c6 100644 --- a/src/converter/registry.cpp +++ b/src/converter/registry.cpp @@ -57,6 +57,24 @@ BOOST_PYTHON_DECL PyObject* registration::to_python(void const volatile* source) : this->m_to_python(const_cast(source)); } +namespace +{ + template< typename T > + void delete_node( T* node ) + { + if( !!node && !!node->next ) + delete_node( node->next ); + delete node; + } +} + +registration::~registration() +{ + delete_node(lvalue_chain); + delete_node(rvalue_chain); +} + + namespace // { typedef registration entry;