diff --git a/include/boost/bind/bind.hpp b/include/boost/bind/bind.hpp index 088ae91..5d0464d 100644 --- a/include/boost/bind/bind.hpp +++ b/include/boost/bind/bind.hpp @@ -485,6 +485,8 @@ template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, // generic function objects +#if !BOOST_WORKAROUND(__GNUC__, < 5) + template _bi::bind_t::type> BOOST_BIND( F f, A... a ) @@ -493,6 +495,92 @@ template return _bi::bind_t( f, list_type( a... ) ); } +#else + +// g++ 4.x considers boost::bind( &X::f ) ambiguous w/ the above + +template + _bi::bind_t::type> + BOOST_BIND( F f ) +{ + typedef typename _bi::list_av<>::type list_type; + return _bi::bind_t( f, list_type() ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4, a5 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4, a5, a6 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4, a5, a6, a7 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4, a5, a6, a7, a8 ) ); +} + +template + _bi::bind_t::type> + BOOST_BIND( F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ) +{ + typedef typename _bi::list_av::type list_type; + return _bi::bind_t( f, list_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) ); +} + +#endif + // generic function objects, alternative syntax template