From 51e4031aaf3b45c140765a8d28eaaf728e90a92f Mon Sep 17 00:00:00 2001 From: Peter Dimov Date: Mon, 14 Oct 2002 16:35:26 +0000 Subject: [PATCH] Fixed g++ 2.95 problem with bind(...) (reported by Alkis Evlogimenos) [SVN r15923] --- include/boost/bind.hpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/include/boost/bind.hpp b/include/boost/bind.hpp index 1c38452..ba94197 100644 --- a/include/boost/bind.hpp +++ b/include/boost/bind.hpp @@ -1133,6 +1133,18 @@ template type; }; +// g++ 2.95 specific helper; used by the data member overload + +template struct add_cref +{ + typedef T const & type; +}; + +template<> struct add_cref +{ + typedef void type; +}; + } // namespace _bi // visit_each @@ -1403,8 +1415,21 @@ template - _bi::bind_t< R const &, _mfi::dm, typename _bi::list_av_1::type > +_bi::bind_t< typename _bi::add_cref::type, _mfi::dm, typename _bi::list_av_1::type > + BOOST_BIND(R T::*f, A1 a1) +{ + typedef _mfi::dm F; + typedef typename _bi::list_av_1::type list_type; + return _bi::bind_t::type, F, list_type>(F(f), list_type(a1)); +} + +#else + +template +_bi::bind_t< R const &, _mfi::dm, typename _bi::list_av_1::type > BOOST_BIND(R T::*f, A1 a1) { typedef _mfi::dm F; @@ -1412,6 +1437,8 @@ template return _bi::bind_t(F(f), list_type(a1)); } +#endif + } // namespace boost #ifndef BOOST_BIND_NO_PLACEHOLDERS