diff --git a/pyptr.h b/pyptr.h index 35de846f..7dde02ac 100644 --- a/pyptr.h +++ b/pyptr.h @@ -16,36 +16,33 @@ # include # include "signatures.h" # include "errors.h" +# include "py.h" -namespace py { +PY_BEGIN_CONVERSION_NAMESPACE - -#ifdef PY_NO_INLINE_FRIENDS_IN_NAMESPACE -} -#endif - -template +template struct PyPtrConversions : Base { inline friend T from_python(PyObject* x, py::Type) - { return T(py::Downcast(x).get(), T::new_ref); } + { return T(py::Downcast(x).get(), T::new_ref); } inline friend T from_python(PyObject* x, py::Type) - { return T(py::Downcast(x).get(), T::new_ref); } + { return T(py::Downcast(x).get(), T::new_ref); } inline friend PyObject* to_python(T x) { return py::as_object(x.release()); } }; -#ifdef PY_NO_INLINE_FRIENDS_IN_NAMESPACE +PY_END_CONVERSION_NAMESPACE + namespace py { -using ::PyPtrConversions; -#endif + +PY_IMPORT_CONVERSION(PyPtrConversions); template class PyPtr - : public PyPtrConversions, + : public PyPtrConversions, T, boost::dereferenceable, T*> > // supplies op-> { public: