1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
3 Copyright (c) 2014 John Fletcher
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 ==============================================================================*/
9 #if !BOOST_PHOENIX_IS_ITERATING
11 #include <boost/utility/enable_if.hpp>
12 #include <boost/type_traits/is_member_function_pointer.hpp>
13 #include <boost/phoenix/core/expression.hpp>
14 #include <boost/phoenix/core/reference.hpp>
15 #include <boost/phoenix/core/detail/function_eval.hpp>
16 #include <boost/phoenix/bind/detail/cpp03/member_function_ptr.hpp>
18 namespace boost { namespace phoenix
21 template <typename RT, typename ClassT, typename ClassA>
23 typename boost::lazy_enable_if<
24 boost::is_member_function_pointer<RT (ClassT::*)()>,
25 typename detail::expression::function_eval<
26 detail::member_function_ptr<0, RT, RT(ClassT::*)()>
29 bind(RT(ClassT::*f)(), ClassA const& obj)
31 typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
33 detail::expression::function_eval<fp_type, ClassA>::make(
39 template <typename RT, typename ClassT, typename ClassA>
41 typename boost::lazy_enable_if<
42 boost::is_member_function_pointer<RT (ClassT::*)()>,
43 typename detail::expression::function_eval<
44 detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
47 bind(RT(ClassT::*f)() const, ClassA const& obj)
50 detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
53 detail::expression::function_eval<fp_type, ClassA>::make(
59 template <typename RT, typename ClassT>
61 typename detail::expression::function_eval<
62 detail::member_function_ptr<0, RT, RT(ClassT::*)()>
65 bind(RT(ClassT::*f)(), ClassT& obj)
67 typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
69 detail::expression::function_eval<
78 template <typename RT, typename ClassT>
80 typename detail::expression::function_eval<
81 detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
84 bind(RT(ClassT::*f)() const, ClassT& obj)
86 typedef detail::member_function_ptr<0, RT, RT(ClassT::*)() const> fp_type;
88 detail::expression::function_eval<
97 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
98 #include <boost/phoenix/bind/detail/cpp03/preprocessed/bind_member_function.hpp>
101 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
102 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_member_function_" BOOST_PHOENIX_LIMIT_STR ".hpp")
105 /*=============================================================================
106 Copyright (c) 2001-2007 Joel de Guzman
108 Distributed under the Boost Software License, Version 1.0. (See accompanying
109 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
110 ==============================================================================*/
112 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
113 #pragma wave option(preserve: 1)
116 #define BOOST_PHOENIX_ITERATION_PARAMS \
117 (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \
118 <boost/phoenix/bind/detail/cpp03/bind_member_function.hpp>))
119 #include BOOST_PHOENIX_ITERATE()
121 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
122 #pragma wave option(output: null)
134 , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
136 , BOOST_PHOENIX_typename_A
139 typename detail::expression::function_eval<
140 detail::member_function_ptr<
141 BOOST_PHOENIX_ITERATION
143 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
149 RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
151 , BOOST_PHOENIX_A_const_ref_a
154 typedef detail::member_function_ptr<
155 BOOST_PHOENIX_ITERATION
157 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
160 detail::expression::function_eval<
174 , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
176 , BOOST_PHOENIX_typename_A
179 typename detail::expression::function_eval<
180 detail::member_function_ptr<
181 BOOST_PHOENIX_ITERATION
183 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
189 RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
191 , BOOST_PHOENIX_A_const_ref_a
194 typedef detail::member_function_ptr<
195 BOOST_PHOENIX_ITERATION
197 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
200 detail::expression::function_eval<
214 , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
215 , BOOST_PHOENIX_typename_A
218 typename detail::expression::function_eval<
219 detail::member_function_ptr<
220 BOOST_PHOENIX_ITERATION
222 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
228 RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
230 , BOOST_PHOENIX_A_const_ref_a
233 typedef detail::member_function_ptr<
234 BOOST_PHOENIX_ITERATION
236 , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
239 detail::expression::function_eval<