1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245
|
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if !BOOST_PHOENIX_IS_ITERATING
#ifndef PHOENIX_BIND_BIND_MEMBER_FUNCTION_HPP
#define PHOENIX_BIND_BIND_MEMBER_FUNCTION_HPP
#include <boost/phoenix/core/expression.hpp>
#include <boost/phoenix/core/reference.hpp>
#include <boost/phoenix/core/detail/function_eval.hpp>
#include <boost/phoenix/bind/detail/member_function_ptr.hpp>
namespace boost { namespace phoenix
{
template <typename RT, typename ClassT, typename ClassA>
inline typename detail::expression::function_eval<
detail::member_function_ptr<0, RT, RT(ClassT::*)()>
, ClassA
>::type const
bind(RT(ClassT::*f)(), ClassA const& obj)
{
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
return
detail::expression::function_eval<fp_type, ClassA>::make(
fp_type(f)
, obj
);
}
template <typename RT, typename ClassT, typename ClassA>
inline typename detail::expression::function_eval<
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
, ClassA
>::type const
bind(RT(ClassT::*f)() const, ClassA const& obj)
{
typedef
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
fp_type;
return
detail::expression::function_eval<fp_type, ClassA>::make(
fp_type(f)
, obj
);
}
template <typename RT, typename ClassT>
inline typename detail::expression::function_eval<
detail::member_function_ptr<0, RT, RT(ClassT::*)()>
, ClassT
>::type const
bind(RT(ClassT::*f)(), ClassT& obj)
{
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
return
detail::expression::function_eval<
fp_type
, ClassT
>::make(
fp_type(f)
, obj
);
}
template <typename RT, typename ClassT>
inline typename detail::expression::function_eval<
detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
, ClassT
>::type const
bind(RT(ClassT::*f)() const, ClassT& obj)
{
typedef detail::member_function_ptr<0, RT, RT(ClassT::*)() const> fp_type;
return
detail::expression::function_eval<
fp_type
, ClassT
>::make(
fp_type(f)
, obj
);
}
#if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
#include <boost/phoenix/bind/preprocessed/bind_member_function.hpp>
#else
#if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_member_function_" BOOST_PHOENIX_LIMIT_STR ".hpp")
#endif
/*=============================================================================
Copyright (c) 2001-2007 Joel de Guzman
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
==============================================================================*/
#if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
#pragma wave option(preserve: 1)
#endif
#define BOOST_PHOENIX_ITERATION_PARAMS \
(3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT), \
<boost/phoenix/bind/bind_member_function.hpp>))
#include BOOST_PHOENIX_ITERATE()
#if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
#pragma wave option(output: null)
#endif
#endif
}}
#endif
#else
template <
typename RT
, typename ClassT
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
, typename ClassA
, BOOST_PHOENIX_typename_A
>
inline
typename detail::expression::function_eval<
detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
>
, ClassA
, BOOST_PHOENIX_A
>::type const
bind(
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
, ClassA const & obj
, BOOST_PHOENIX_A_const_ref_a
)
{
typedef detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
> fp_type;
return
detail::expression::function_eval<
fp_type
, ClassA
, BOOST_PHOENIX_A
>::make(
fp_type(f)
, obj
, BOOST_PHOENIX_a
);
}
template <
typename RT
, typename ClassT
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
, typename ClassA
, BOOST_PHOENIX_typename_A
>
inline
typename detail::expression::function_eval<
detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
>
, ClassA
, BOOST_PHOENIX_A
>::type const
bind(
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
, ClassA const & obj
, BOOST_PHOENIX_A_const_ref_a
)
{
typedef detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
> fp_type;
return
detail::expression::function_eval<
fp_type
, ClassA
, BOOST_PHOENIX_A
>::make(
fp_type(f)
, obj
, BOOST_PHOENIX_a
);
}
template <
typename RT
, typename ClassT
, BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
, BOOST_PHOENIX_typename_A
>
inline
typename detail::expression::function_eval<
detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
>
, ClassT
, BOOST_PHOENIX_A
>::type const
bind(
RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
, ClassT & obj
, BOOST_PHOENIX_A_const_ref_a
)
{
typedef detail::member_function_ptr<
BOOST_PHOENIX_ITERATION
, RT
, RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
> fp_type;
return
detail::expression::function_eval<
fp_type
, ClassT
, BOOST_PHOENIX_A
>::make(
fp_type(f)
, obj
, BOOST_PHOENIX_a
);
}
#endif
|