@@ -169,7 +169,9 @@ namespace detail \
169169 template <class L , class R > \
170170 struct apply \
171171 { \
172- static inline PyObject* execute (L& l, R const & r) \
172+ typedef typename unwrap_wrapper_<L>::type lhs; \
173+ typedef typename unwrap_wrapper_<R>::type rhs; \
174+ static PyObject* execute (lhs& l, rhs const & r) \
173175 { \
174176 return detail::convert_result (expr); \
175177 } \
@@ -183,7 +185,9 @@ namespace detail \
183185 template <class L , class R > \
184186 struct apply \
185187 { \
186- static inline PyObject* execute (R& r, L const & l) \
188+ typedef typename unwrap_wrapper_<L>::type lhs; \
189+ typedef typename unwrap_wrapper_<R>::type rhs; \
190+ static PyObject* execute (rhs& r, lhs const & l) \
187191 { \
188192 return detail::convert_result (expr); \
189193 } \
@@ -271,8 +275,10 @@ namespace detail \
271275 template <class L , class R > \
272276 struct apply \
273277 { \
274- static inline PyObject* \
275- execute (back_reference<L&> l, R const & r) \
278+ typedef typename unwrap_wrapper_<L>::type lhs; \
279+ typedef typename unwrap_wrapper_<R>::type rhs; \
280+ static PyObject* \
281+ execute (back_reference<lhs&> l, rhs const & r) \
276282 { \
277283 l.get () op r; \
278284 return python::incref (l.source ().ptr ()); \
@@ -311,7 +317,8 @@ namespace detail \
311317 template <class T > \
312318 struct apply \
313319 { \
314- static PyObject* execute (T& x) \
320+ typedef typename unwrap_wrapper_<T>::type self_t ; \
321+ static PyObject* execute (self_t & x) \
315322 { \
316323 return detail::convert_result (op (x)); \
317324 } \
@@ -339,6 +346,7 @@ BOOST_PYTHON_UNARY_OPERATOR(long, PyLong_FromLong, long_)
339346BOOST_PYTHON_UNARY_OPERATOR (float , double , float_)
340347BOOST_PYTHON_UNARY_OPERATOR (complex , std::complex <double >, complex_)
341348BOOST_PYTHON_UNARY_OPERATOR (str, lexical_cast<std::string>, str)
349+ BOOST_PYTHON_UNARY_OPERATOR (repr, lexical_cast<std::string>, repr)
342350# undef BOOST_PYTHON_UNARY_OPERATOR
343351
344352}} // namespace boost::python
@@ -350,6 +358,7 @@ using boost::python::self_ns::long_;
350358using boost::python::self_ns::float_;
351359using boost::python::self_ns::complex_;
352360using boost::python::self_ns::str;
361+ using boost::python::self_ns::repr;
353362using boost::python::self_ns::pow;
354363# endif
355364
0 commit comments