Chris@16: /*============================================================================= Chris@16: Copyright (c) 2001-2007 Joel de Guzman Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. (See accompanying Chris@16: file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: ==============================================================================*/ Chris@16: #ifndef PHOENIX_BIND_BIND_FUNCTION_HPP Chris@16: #define PHOENIX_BIND_BIND_FUNCTION_HPP Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace phoenix Chris@16: { Chris@16: template Chris@16: inline actor< Chris@16: typename as_composite< Chris@16: detail::function_eval<0> Chris@16: , detail::function_ptr<0, RT, RT(*)()> Chris@16: >::type> Chris@16: bind(RT(*f)()) Chris@16: { Chris@16: typedef detail::function_ptr<0, RT, RT(*)()> fp_type; Chris@16: return compose >(fp_type(f)); Chris@16: } Chris@16: Chris@16: template Chris@16: inline actor< Chris@16: typename as_composite< Chris@16: detail::function_eval<1> Chris@16: , detail::function_ptr<1, RT, RT(*)(T0)> Chris@16: , A0 Chris@16: >::type> Chris@16: bind(RT(*f)(T0), A0 const& _0) Chris@16: { Chris@16: typedef detail::function_ptr<1, RT, RT(*)(T0)> fp_type; Chris@16: return compose >(fp_type(f), _0); Chris@16: } Chris@16: Chris@16: template Chris@16: inline actor< Chris@16: typename as_composite< Chris@16: detail::function_eval<2> Chris@16: , detail::function_ptr<2, RT, RT(*)(T0, T1)> Chris@16: , A0, A1 Chris@16: >::type> Chris@16: bind(RT(*f)(T0, T1), A0 const& _0, A1 const& _1) Chris@16: { Chris@16: typedef detail::function_ptr<2, RT, RT(*)(T0, T1)> fp_type; Chris@16: return compose >(fp_type(f), _0, _1); Chris@16: } Chris@16: Chris@16: // Bring in the rest of the function binders Chris@16: #include Chris@16: }} Chris@16: Chris@16: #endif