diff --git a/include/boost/python/converter/python_type.hpp b/include/boost/python/converter/python_type.hpp index f0c7e179..4bf9893a 100755 --- a/include/boost/python/converter/python_type.hpp +++ b/include/boost/python/converter/python_type.hpp @@ -5,16 +5,23 @@ namespace boost {namespace python {namespace converter{ namespace detail{ - inline void * identity (PyObject *p){return p;} namespace strip_type_info{ BOOST_PYTHON_DECL void insert(boost::python::type_info, boost::python::type_info); BOOST_PYTHON_DECL type_info query(boost::python::type_info); } + + class python_class_base : public PyObject{ + python_class_base (); + public: + static void *converter (PyObject *p){return p;} + }; + + }// namespace converter::detail -template struct python_class : PyObject +template struct python_class : detail::python_class_base { typedef python_class this_type; typedef T type; @@ -24,14 +31,12 @@ template struct python_class : PyObject if ( !first_time ) return; first_time = false; - converter::registry::insert(&detail::identity, boost::python::type_id()); + converter::registry::insert(&detail::python_class_base::converter, boost::python::type_id()); converter::detail::strip_type_info::insert(boost::python::type_id(), boost::python::type_id()); converter::detail::strip_type_info::insert(boost::python::type_id(), boost::python::type_id()); converter::detail::strip_type_info::insert(boost::python::type_id(), boost::python::type_id()); converter::detail::strip_type_info::insert(type_id(), type_id >()); } -private: - python_class(); };