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