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: Chris@16: #if !BOOST_PHOENIX_IS_ITERATING 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: typename RT Chris@16: > Chris@16: inline Chris@16: typename detail::expression::function_eval< Chris@16: detail::function_ptr<0, RT, RT(*)()> Chris@16: >::type const Chris@16: bind(RT(*f)()) Chris@16: { Chris@16: typedef detail::function_ptr<0, RT, RT(*)()> fp_type; Chris@16: return detail::expression::function_eval::make(fp_type(f)); Chris@16: } Chris@16: Chris@16: template < Chris@16: typename RT Chris@16: , typename T0 Chris@16: , typename A0 Chris@16: > Chris@16: inline Chris@16: typename detail::expression::function_eval< Chris@16: detail::function_ptr<1, RT, RT(*)(T0)> Chris@16: , A0 Chris@16: >::type const Chris@16: bind(RT(*f)(T0), A0 const & a0) Chris@16: { Chris@16: typedef detail::function_ptr<1, RT, RT(*)(T0)> fp_type; Chris@16: return detail::expression::function_eval::make(fp_type(f), a0); Chris@16: } Chris@16: Chris@16: #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES) Chris@16: #include Chris@16: #else Chris@16: Chris@16: #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_function_" BOOST_PHOENIX_LIMIT_STR ".hpp") Chris@16: #endif Chris@16: 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: Chris@16: #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(preserve: 1) Chris@16: #endif Chris@16: Chris@16: #define BOOST_PHOENIX_ITERATION_PARAMS \ Chris@16: (3, (2, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \ Chris@16: )) Chris@16: #include BOOST_PHOENIX_ITERATE() Chris@16: Chris@16: #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES) Chris@16: #pragma wave option(output: null) Chris@16: #endif Chris@16: Chris@16: #endif Chris@16: Chris@16: }} Chris@16: Chris@16: #endif Chris@16: Chris@16: #else Chris@16: Chris@16: template < Chris@16: typename RT Chris@16: , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T) Chris@16: , BOOST_PHOENIX_typename_A Chris@16: > Chris@16: inline Chris@16: typename detail::expression::function_eval< Chris@16: detail::function_ptr< Chris@16: BOOST_PHOENIX_ITERATION Chris@16: , RT Chris@16: , RT(*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) Chris@16: > Chris@16: , BOOST_PHOENIX_A Chris@16: >::type const Chris@16: bind( Chris@16: RT(*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) Chris@16: , BOOST_PHOENIX_A_const_ref_a Chris@16: ) Chris@16: { Chris@16: typedef detail::function_ptr< Chris@16: BOOST_PHOENIX_ITERATION Chris@16: , RT Chris@16: , RT(*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) Chris@16: > fp_type; Chris@16: return Chris@16: detail::expression::function_eval< Chris@16: fp_type Chris@16: , BOOST_PHOENIX_A Chris@16: >::make( Chris@16: fp_type(f) Chris@16: , BOOST_PHOENIX_a Chris@16: ); Chris@16: } Chris@16: Chris@16: #endif