From f6e12ce9047c8d847970840afa2fd19e3207252a Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 8 Nov 2000 20:10:14 +0000 Subject: [PATCH] Add missing from_python functions for const T *const& and T* const& [SVN r8159] --- extclass.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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())); }