From aa715e88d49b762af0d5c8540ccaa38310e623dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaakko=20J=C3=A4rvi?= Date: Tue, 18 Dec 2001 16:23:53 +0000 Subject: [PATCH] return type deduction should not fail now [SVN r12111] --- include/boost/lambda/detail/member_ptr.hpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/boost/lambda/detail/member_ptr.hpp b/include/boost/lambda/detail/member_ptr.hpp index ad8c387..56e632f 100644 --- a/include/boost/lambda/detail/member_ptr.hpp +++ b/include/boost/lambda/detail/member_ptr.hpp @@ -28,6 +28,9 @@ namespace detail { // need to know more details. template struct member_pointer { + typedef typename boost::add_reference::type type; + typedef detail::unspecified class_type; + typedef detail::unspecified qualified_class_type; BOOST_STATIC_CONSTANT(bool, is_data_member = false); BOOST_STATIC_CONSTANT(bool, is_function_member = false); }; @@ -499,6 +502,8 @@ struct member_pointer_action_helper; // cannot be both, no body provided // data member case + // this means, that B is a data member and A is a pointer type, + // so either built-in ->* should be called, or there is an error template <> struct member_pointer_action_helper { public: @@ -548,8 +553,7 @@ public: // the return type template struct return_type { - typedef typename - detail::generate_error::return_type_not_specified type; + typedef detail::unspecified type; }; }; @@ -558,6 +562,8 @@ public: // member pointer function case // This is a built in ->* call for a member function, // the only thing that you can do with that, is to give it some arguments +// note, it is guaranteed that A is a pointer type, and thus it cannot +// be a call to overloaded ->* template <> struct member_pointer_action_helper { public: @@ -593,8 +599,10 @@ public: return detail::member_pointer_action_helper< - detail::member_pointer::is_data_member, - detail::member_pointer::is_function_member + boost::is_pointer::value && + detail::member_pointer::is_data_member, + boost::is_pointer::value && + detail::member_pointer::is_function_member >::template apply(a, b); } };