From 42efa96a2f528e1ec68e147e065d900a4991983f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Sun, 6 Nov 2005 16:02:50 +0000 Subject: [PATCH] Attempted fix for IBM C++ 6.0, better heuristic [SVN r31579] --- include/boost/bind.hpp | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index 849ed9a..f6ec475 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -1581,11 +1581,30 @@ template< class R, class T > struct add_cref< R (T::*) (), 1 > typedef void type; }; +#if !( defined(__IBMCPP__) && BOOST_WORKAROUND( __IBMCPP__, BOOST_TESTED_AT(600) ) ) + template< class R, class T > struct add_cref< R (T::*) () const, 1 > { typedef void type; }; +#endif + +template struct isref +{ + enum value_type { value = 0 }; +}; + +template struct isref< R& > +{ + enum value_type { value = 1 }; +}; + +template struct isref< R* > +{ + enum value_type { value = 1 }; +}; + template struct dm_result { typedef typename add_cref< Pm, 1 >::type type; @@ -1593,12 +1612,8 @@ template struct dm_result template struct dm_result< Pm, bind_t > { - typedef typename add_cref< Pm, 0 >::type type; -}; - -template struct dm_result< Pm, bind_t > -{ - typedef typename add_cref< Pm, 1 >::type type; + typedef typename bind_t::result_type result_type; + typedef typename add_cref< Pm, isref< result_type >::value >::type type; }; } // namespace _bi