From 97b863101ba7bf71a5eeeb827829d100e2d0673c Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Mon, 13 May 2002 16:33:55 +0000 Subject: [PATCH] Add result_type definition [SVN r13839] --- include/boost/python/converter/from_python.hpp | 11 +++++++++-- include/boost/python/from_python.hpp | 3 +++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/include/boost/python/converter/from_python.hpp b/include/boost/python/converter/from_python.hpp index a4923ae5..40a75645 100644 --- a/include/boost/python/converter/from_python.hpp +++ b/include/boost/python/converter/from_python.hpp @@ -43,6 +43,8 @@ struct from_python_base template struct pointer_const_reference_from_python { + typedef T result_type; + pointer_const_reference_from_python(PyObject*); T operator()(PyObject*) const; bool convertible() const; @@ -55,6 +57,8 @@ struct pointer_const_reference_from_python template struct pointer_from_python : from_python_base { + typedef T result_type; + pointer_from_python(PyObject*); T operator()(PyObject*) const; }; @@ -63,6 +67,8 @@ struct pointer_from_python : from_python_base template struct reference_from_python : from_python_base { + typedef T result_type; + reference_from_python(PyObject*); T operator()(PyObject*) const; }; @@ -72,13 +78,12 @@ struct reference_from_python : from_python_base // Used for the case where T is a non-pointer, non-reference type OR // is a const non-volatile reference to a non-pointer type. template -class rvalue_from_python +struct rvalue_from_python { typedef typename boost::add_reference< typename boost::add_const::type >::type result_type; - public: rvalue_from_python(PyObject*); bool convertible() const; @@ -97,6 +102,8 @@ template struct back_reference_from_python : boost::python::from_python { + typedef T result_type; + back_reference_from_python(PyObject*); T operator()(PyObject*); private: diff --git a/include/boost/python/from_python.hpp b/include/boost/python/from_python.hpp index 726928ac..340a014a 100644 --- a/include/boost/python/from_python.hpp +++ b/include/boost/python/from_python.hpp @@ -22,6 +22,8 @@ struct from_python template <> struct from_python { + typedef PyObject* result_type; + from_python(PyObject*) {} bool convertible() const { return true; } PyObject* operator()(PyObject* source) const { return source; } @@ -30,6 +32,7 @@ struct from_python template <> struct from_python { + typedef PyObject* const& result_type; from_python(PyObject*) {} bool convertible() const { return true; } PyObject*const& operator()(PyObject*const& source) const { return source; }