From ae0ed5633785fce193903f157e607dd0349f52d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Thu, 10 Oct 2002 22:04:40 +0000 Subject: [PATCH] bugfix [SVN r15887] --- include/boost/lambda/detail/member_ptr.hpp | 29 ++++++++-------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/include/boost/lambda/detail/member_ptr.hpp b/include/boost/lambda/detail/member_ptr.hpp index a45e723..8acda5c 100644 --- a/include/boost/lambda/detail/member_ptr.hpp +++ b/include/boost/lambda/detail/member_ptr.hpp @@ -436,10 +436,10 @@ namespace detail { template class member_pointer_caller { - A a; - B b; + A a; B b; + public: - member_pointer_caller(A aa, B bb) : a(aa), b(bb) {} + member_pointer_caller(const A& aa, const B& bb) : a(aa), b(bb) {} RET operator()() const { return (a->*b)(); } @@ -589,29 +589,24 @@ struct member_pointer_action_helper { template static RET apply(A& a, B& b) { - typedef typename ::boost::remove_cv::type plainB; typedef typename detail::member_pointer::type ret_t; + typedef typename ::boost::remove_cv::type plainA; - // we always add const (it is just the pointer types, not the types - // pointed to) to make the to routes (calling and type deduction) + // we always strip cv:s to + // make the two routes (calling and type deduction) // to give the same results (and the const does not make any functional // difference) - return detail::member_pointer_caller(a, b); + return detail::member_pointer_caller(a, b); } template struct return_type { typedef typename detail::remove_reference_and_cv::type plainB; typedef typename detail::member_pointer::type ret_t; + typedef typename detail::remove_reference_and_cv::type plainA; - // we always add const (it is just the pointer types, not the types - // pointed to) - typedef detail::member_pointer_caller< - ret_t, - typename boost::add_reference::type, - typename boost::add_reference::type - > type; + typedef detail::member_pointer_caller type; }; }; @@ -621,17 +616,15 @@ template<> class other_action { public: template static RET apply(A& a, B& b) { - typedef typename ::boost::remove_cv::type plainB; - return - detail::member_pointer_action_helper< + return detail::member_pointer_action_helper< boost::is_pointer::value && detail::member_pointer::is_data_member, boost::is_pointer::value && detail::member_pointer::is_function_member - >::template apply(a, b); + >::template apply(a, b); } };