diff --git a/extclass.h b/extclass.h index 0840120f..bf91c198 100644 --- a/extclass.h +++ b/extclass.h @@ -149,7 +149,7 @@ class PyExtensionClassConverters } // This is a member function because in a conforming implementation, friend - // funcitons defined inline in the class body are all instantiated as soon + // functions defined inline in the class body are all instantiated as soon // as the enclosing class is instantiated. If T is not copyable, that causes // a compiler error. Instead, we access this function through the global // template @@ -233,7 +233,15 @@ class PyExtensionClassConverters friend const T* from_python(PyObject* p, py::Type) { return from_python(p, py::Type()); } - // Convert to T& + // Convert to const T* const& + friend const T* from_python(PyObject* p, py::Type) + { return from_python(p, py::Type()); } + + // Convert to T* const& + friend T* from_python(PyObject* p, py::Type) + { return from_python(p, py::Type()); } + + // Convert to T& friend T& from_python(PyObject* p, py::Type) { return *py::check_non_null(from_python(p, py::Type())); }