From 7230b5886ffd6a1ac89c367e1a9b4f2b2a3ba487 Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Fri, 3 Nov 2000 15:59:49 +0000 Subject: [PATCH] Fix friend function instantiation bug caught by Metrowerks (thanks Metrowerks!) [SVN r8111] --- pyptr.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pyptr.h b/pyptr.h index f6437f4a..81bd7f55 100644 --- a/pyptr.h +++ b/pyptr.h @@ -28,13 +28,13 @@ template struct PyPtrConversions : Base { inline friend T from_python(PyObject* x, py::Type) - { return T(x, T::new_ref); } + { return T(py::Downcast(x).get(), T::new_ref); } inline friend T from_python(PyObject* x, py::Type) - { return T(x, T::new_ref); } + { return T(py::Downcast(x).get(), T::new_ref); } inline friend PyObject* to_python(T x) - { return x.release(); } + { return as_object(x.release()); } }; @@ -49,6 +49,8 @@ class PyPtr boost::dereferenceable, T*> > // supplies op-> { public: + typedef T value_type; + PyPtr(const PyPtr& rhs) : m_p(rhs.m_p) {