1 /*=============================================================================
2 Copyright (c) 2005-2007 Dan Marsden
3 Copyright (c) 2005-2007 Joel de Guzman
5 Distributed under the Boost Software License, Version 1.0. (See accompanying
6 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 ==============================================================================*/
8 #ifndef BOOST_PP_IS_ITERATING
9 #ifndef PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_GEN_HPP
10 #define PHOENIX_OPERATOR_DETAIL_MEM_FUN_PTR_GEN_HPP
12 #include <boost/spirit/home/phoenix/core/composite.hpp>
13 #include <boost/spirit/home/phoenix/core/compose.hpp>
14 #include <boost/spirit/home/phoenix/core/as_actor.hpp>
15 #include <boost/spirit/home/phoenix/core/limits.hpp>
16 #include <boost/spirit/home/phoenix/core/actor.hpp>
18 #include <boost/preprocessor/repetition/enum_params.hpp>
19 #include <boost/preprocessor/repetition/enum_binary_params.hpp>
20 #include <boost/preprocessor/iteration/iterate.hpp>
21 #include <boost/preprocessor/arithmetic/dec.hpp>
23 #include <boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_eval.hpp>
25 namespace boost { namespace phoenix {
26 template<typename Actor, typename MemFunPtr>
27 struct mem_fun_ptr_gen
30 const Actor& actor, MemFunPtr memFunPtr)
31 : mActor(actor), mMemFunPtr(memFunPtr) { }
33 actor<typename as_composite<mem_fun_ptr_eval, Actor, typename as_actor<MemFunPtr>::type>::type>
36 return compose<mem_fun_ptr_eval>(
37 mActor, as_actor<MemFunPtr>::convert(mMemFunPtr));
40 #define BOOST_PP_ITERATION_PARAMS_1 \
41 (3, (1, BOOST_PP_DEC(BOOST_PP_DEC(PHOENIX_MEMBER_LIMIT)), "boost/spirit/home/phoenix/operator/detail/mem_fun_ptr_gen.hpp"))
43 #include BOOST_PP_ITERATE()
53 #define PHOENIX_ITERATION BOOST_PP_ITERATION()
55 template<BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, typename Arg)>
56 actor<typename as_composite<
57 mem_fun_ptr_eval, Actor, typename as_actor<MemFunPtr>::type,
58 BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, Arg)>::type>
60 BOOST_PP_ENUM_BINARY_PARAMS(PHOENIX_ITERATION, const Arg, &arg)) const
62 return compose<mem_fun_ptr_eval>(
63 mActor, as_actor<MemFunPtr>::convert(mMemFunPtr),
64 BOOST_PP_ENUM_PARAMS(PHOENIX_ITERATION, arg));
67 #undef PHOENIX_ITERATION