File indexing completed on 2025-01-18 09:39:14
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
0009 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_HPP_
0010
0011 #include <boost/local_function/config.hpp>
0012 #include <boost/local_function/aux_/symbol.hpp>
0013 #include <boost/local_function/aux_/function.hpp>
0014 #include <boost/local_function/aux_/add_pointed_const.hpp>
0015 #include <boost/local_function/aux_/member.hpp>
0016 #include <boost/local_function/aux_/nobind.hpp>
0017 #include <boost/local_function/aux_/macro/decl.hpp>
0018 #include <boost/local_function/aux_/macro/typeof.hpp>
0019 #include <boost/local_function/aux_/macro/code_/result.hpp>
0020 #include <boost/local_function/aux_/macro/code_/bind.hpp>
0021 #include <boost/local_function/aux_/preprocessor/traits/decl_params.hpp>
0022 #include <boost/local_function/aux_/preprocessor/traits/decl_binds.hpp>
0023 #include <boost/local_function/aux_/preprocessor/traits/decl_const_binds.hpp>
0024 #include <boost/local_function/detail/preprocessor/keyword/auto.hpp>
0025 #include <boost/local_function/detail/preprocessor/keyword/register.hpp>
0026 #include <boost/local_function/detail/preprocessor/keyword/thisunderscore.hpp>
0027 #include <boost/utility/identity_type.hpp>
0028 #include <boost/scope_exit.hpp>
0029 #include <boost/type_traits/add_const.hpp>
0030 #include <boost/preprocessor/cat.hpp>
0031 #include <boost/preprocessor/punctuation/comma_if.hpp>
0032 #include <boost/preprocessor/control/expr_iif.hpp>
0033 #include <boost/preprocessor/control/iif.hpp>
0034 #include <boost/preprocessor/facilities/expand.hpp>
0035 #include <boost/preprocessor/facilities/is_empty.hpp>
0036 #include <boost/preprocessor/facilities/empty.hpp>
0037 #include <boost/preprocessor/facilities/identity.hpp>
0038 #include <boost/preprocessor/repetition/enum.hpp>
0039 #include <boost/preprocessor/repetition/repeat.hpp>
0040 #include <boost/preprocessor/arithmetic/inc.hpp>
0041 #include <boost/preprocessor/arithmetic/sub.hpp>
0042 #include <boost/preprocessor/arithmetic/add.hpp>
0043 #include <boost/preprocessor/logical/bitor.hpp>
0044 #include <boost/preprocessor/logical/bitand.hpp>
0045 #include <boost/preprocessor/logical/compl.hpp>
0046 #include <boost/preprocessor/tuple/elem.hpp>
0047 #include <boost/preprocessor/tuple/eat.hpp>
0048 #include <boost/preprocessor/tuple/rem.hpp>
0049 #include <boost/preprocessor/list/adt.hpp>
0050 #include <boost/preprocessor/list/size.hpp>
0051 #include <boost/preprocessor/list/for_each_i.hpp>
0052 #include <boost/preprocessor/list/first_n.hpp>
0053
0054
0055
0056 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
0057 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (functor)(id) )
0058
0059 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
0060 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (function_type) )
0061
0062 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_ \
0063 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (body) )
0064
0065
0066
0067
0068 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(i) \
0069 \
0070 \
0071 \
0072 BOOST_PP_CAT(arg, i)
0073
0074 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_( \
0075 r, unused, i, param_traits) \
0076 BOOST_PP_COMMA_IF(i) \
0077 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
0078
0079
0080 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, i) \
0081 \
0082 \
0083 \
0084 BOOST_PP_EXPR_IIF(typename01, typename) \
0085 ::boost::function_traits< \
0086 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
0087 >::BOOST_PP_CAT(BOOST_PP_CAT(arg, i), _type) \
0088
0089 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_ARG_TYPEDEF_( \
0090 r, typename01, i, param_traits) \
0091 typedef \
0092 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
0093 BOOST_PP_INC(i)) \
0094 \
0095 BOOST_PP_CAT(BOOST_PP_CAT(arg, BOOST_PP_INC(i)), _type) \
0096 ;
0097
0098 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_( \
0099 r, typename01, i, param_traits) \
0100 BOOST_PP_EXPR_IIF(typename01, typename) \
0101 ::boost::call_traits< \
0102 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_TYPE_(typename01, \
0103 BOOST_PP_INC(i)) \
0104 >::param_type \
0105 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_(BOOST_PP_INC(i))
0106
0107 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_( \
0108 r, typename01, i, param_traits) \
0109 BOOST_PP_COMMA_IF(i) \
0110 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
0111 param_traits)
0112
0113 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_( \
0114 r, typename01, i, param_traits) \
0115 , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_(r, typename01, i, \
0116 param_traits)
0117
0118
0119 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_( \
0120 param_traits) \
0121 = BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_DEFAULT_REMOVE_FRONT( \
0122 BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits))
0123
0124 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_( \
0125 r, default01, i, param_traits) \
0126 BOOST_PP_COMMA_IF(i) \
0127 BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_AUTO_REMOVE_BACK( \
0128 BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_REGISTER_REMOVE_BACK( \
0129 BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DECL(param_traits) \
0130 )) \
0131 BOOST_PP_IIF(BOOST_PP_COMPL(default01), \
0132 BOOST_PP_TUPLE_EAT(1) \
0133 , BOOST_PP_IIF(BOOST_PP_IS_EMPTY( \
0134 BOOST_LOCAL_FUNCTION_AUX_PP_PARAM_TRAITS_DEFAULT(param_traits)), \
0135 BOOST_PP_TUPLE_EAT(1) \
0136 , \
0137 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DEFAULT_ASSIGNMENT_ \
0138 ))(param_traits)
0139
0140
0141
0142 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_ \
0143 bind_params
0144
0145 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_(i) \
0146 \
0147 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (bind)(i) )
0148
0149 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
0150 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (bind_this) )
0151
0152 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_( \
0153 id) \
0154 , static_cast< BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* >( \
0155 object)->BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_
0156
0157 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPE_( \
0158 id, typename01, offset, i, bind_var_without_type) \
0159 BOOST_PP_EXPR_IIF(typename01, typename) \
0160 BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id):: \
0161 BOOST_SCOPE_EXIT_DETAIL_PARAM_T(id, BOOST_PP_ADD(i, offset), \
0162 bind_var_without_type) \
0163
0164 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_( \
0165 r, offset, i, bind_traits) \
0166 BOOST_PP_COMMA_IF(i) \
0167 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
0168 BOOST_PP_ADD(offset, i))
0169
0170 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
0171 r, id_typename_offset_const, i, bind_var_without_type) \
0172 \
0173 \
0174 \
0175 BOOST_PP_IIF(BOOST_PP_COMPL(BOOST_PP_TUPLE_ELEM(4, 3, \
0176 id_typename_offset_const)), \
0177 BOOST_PP_EMPTY \
0178 , BOOST_PP_IIF( \
0179 BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
0180 bind_var_without_type), \
0181 \
0182 BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
0183 typename \
0184 ) \
0185 BOOST_PP_IDENTITY( ::boost::local_function::aux::add_pointed_const< ) \
0186 , \
0187 BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
0188 typename \
0189 ) \
0190 BOOST_PP_IDENTITY( ::boost::add_const< ) \
0191 ))() \
0192 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPE_( \
0193 BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const), \
0194 BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
0195 BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), \
0196 i, bind_var_without_type) \
0197 BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 3, id_typename_offset_const), \
0198 >::type \
0199 )
0200
0201 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
0202 r, id_typename_offset_const, i, bind_var_without_type) \
0203 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
0204 r, id_typename_offset_const, i, bind_var_without_type) \
0205 BOOST_PP_IIF( \
0206 BOOST_LOCAL_FUNCTION_DETAIL_PP_KEYWORD_IS_THISUNDERSCORE_BACK( \
0207 BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0208 bind_var_without_type)), \
0209 this_ BOOST_PP_TUPLE_EAT(1) \
0210 , \
0211 BOOST_PP_TUPLE_REM(1) \
0212 )(bind_var_without_type)
0213
0214 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_( \
0215 r, id_typename_offset_const, i, bind_traits) \
0216 , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
0217 r, id_typename_offset_const, i, \
0218 BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0219 bind_traits))
0220
0221 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
0222 offset, i) \
0223 BOOST_PP_CAT(bind, BOOST_PP_ADD(offset, i))
0224
0225 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_( \
0226 r, offset, i, bind_traits) \
0227 BOOST_PP_COMMA_IF(i) \
0228 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_(offset, i)
0229
0230 #define \
0231 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_( \
0232 r, id_typename_offset_const, i, bind_traits) \
0233 , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
0234 r, id_typename_offset_const, i, \
0235 BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0236 bind_traits)) & \
0237 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_( \
0238 BOOST_PP_TUPLE_ELEM(4, 2, id_typename_offset_const), i)
0239
0240 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_( \
0241 id, typename01) \
0242 , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01)
0243
0244 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_ \
0245 bind_this
0246
0247 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_( \
0248 id, typename01) \
0249 , BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) & \
0250 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_
0251
0252 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_(z, n, unused) \
0253 , ::boost::local_function::aux::nobind
0254
0255 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_(z, n, unused) \
0256 , ::boost::local_function::aux::nobind_t
0257
0258 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_( \
0259 z, n, unused) \
0260 , ::boost::local_function::aux::nobind_t & \
0261
0262
0263 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_( \
0264 r, id_typename_offset_const, i, bind_traits) \
0265 BOOST_PP_COMMA_IF(i) \
0266 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
0267 r, id_typename_offset_const, i, \
0268 BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0269 bind_traits))
0270
0271 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_( \
0272 r, id_typename_offset_const, i, bind_traits) \
0273 BOOST_PP_EXPR_IIF(BOOST_PP_TUPLE_ELEM(4, 1, id_typename_offset_const), \
0274 typename \
0275 ) \
0276 ::boost::local_function::aux::member_type< \
0277 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_TYPE_( \
0278 r, id_typename_offset_const, i, bind_var_without_type) \
0279 >::reference \
0280 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
0281 BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
0282 id_typename_offset_const))) \
0283 ;
0284
0285 #define \
0286 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_( \
0287 r, id_typename_offset_const, i, bind_traits) \
0288 , static_cast< BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_( \
0289 BOOST_PP_TUPLE_ELEM(4, 0, id_typename_offset_const))* >(object)-> \
0290 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
0291 BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(4, 2, \
0292 id_typename_offset_const)))
0293
0294 #define \
0295 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_( \
0296 r, id_offset, i, bind_traits) \
0297 BOOST_PP_COMMA_IF(i) \
0298 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_VAR_( \
0299 BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset))) \
0300 ( \
0301 static_cast< \
0302 BOOST_SCOPE_EXIT_DETAIL_PARAMS_T( \
0303 BOOST_PP_TUPLE_ELEM(2, 0, id_offset))* \
0304 >(BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_)-> \
0305 BOOST_SCOPE_EXIT_DETAIL_PARAM( \
0306 BOOST_PP_TUPLE_ELEM(2, 0, id_offset) \
0307 , BOOST_PP_ADD(i, BOOST_PP_TUPLE_ELEM(2, 1, id_offset)) \
0308 , BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0309 bind_traits) \
0310 ).value \
0311 )
0312
0313
0314
0315 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_( \
0316 r, id_typename_offset_const, i, bind_traits) \
0317 typedef \
0318 BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
0319 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_( \
0320 r, id_typename_offset_const, i, \
0321 BOOST_LOCAL_FUNCTION_AUX_PP_BIND_TRAITS_VAR_WITHOUT_TYPE( \
0322 bind_traits)) \
0323 ) \
0324 ;
0325
0326
0327 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_( \
0328 id, typename01, decl_traits, has_type, function_type) \
0329 BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
0330 BOOST_PP_EXPR_IIF(has_type, (function_type) ) \
0331 ( \
0332 BOOST_PP_LIST_FOR_EACH_I( \
0333 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
0334 0, \
0335 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits)) \
0336 )
0337
0338
0339
0340 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01, \
0341 const_bind_macro, bind_macro, const_bind_this_macro, bind_this_macro, \
0342 param_macro, params, \
0343 const_binds, has_const_bind_this, binds, has_bind_this) \
0344 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_( \
0345 BOOST_PP_LIST_FOR_EACH_I(const_bind_macro, \
0346 0 , const_binds) \
0347 \
0348 BOOST_PP_COMMA_IF( \
0349 BOOST_PP_BITAND( \
0350 BOOST_PP_LIST_IS_CONS(const_binds) \
0351 , BOOST_PP_LIST_IS_CONS(binds) \
0352 ) \
0353 ) \
0354 BOOST_PP_LIST_FOR_EACH_I(bind_macro, \
0355 \
0356 BOOST_PP_LIST_SIZE(const_binds), binds) \
0357 \
0358 BOOST_PP_COMMA_IF( \
0359 BOOST_PP_BITAND( \
0360 BOOST_PP_BITOR( \
0361 BOOST_PP_LIST_IS_CONS(const_binds) \
0362 , BOOST_PP_LIST_IS_CONS(binds) \
0363 ) \
0364 , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
0365 ) \
0366 ) \
0367 BOOST_PP_EXPR_IIF(has_const_bind_this, const_bind_this_macro) \
0368 BOOST_PP_EXPR_IIF(has_bind_this, bind_this_macro) \
0369 \
0370 BOOST_PP_COMMA_IF( \
0371 BOOST_PP_BITAND( \
0372 BOOST_PP_BITOR( \
0373 BOOST_PP_BITOR( \
0374 BOOST_PP_LIST_IS_CONS(const_binds) \
0375 , BOOST_PP_LIST_IS_CONS(binds) \
0376 ) \
0377 , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
0378 ) \
0379 , BOOST_PP_LIST_IS_CONS(params) \
0380 ) \
0381 ) \
0382 BOOST_PP_LIST_FOR_EACH_I(param_macro, ~, params) \
0383 )
0384
0385 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_(z, defaults_n, \
0386 id, typename01, decl_traits, params, \
0387 const_binds, has_const_bind_this, binds, has_bind_this) \
0388 inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
0389 operator()( \
0390 BOOST_PP_LIST_FOR_EACH_I( \
0391 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_DECL_ENUM_, \
0392 typename01, params) \
0393 ) { \
0394 \
0395 return BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01,\
0396 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
0397 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_MEMBER_BIND_ENUM_, \
0398 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
0399 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_, \
0400 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
0401 params, const_binds, has_const_bind_this, binds, \
0402 has_bind_this); \
0403 }
0404
0405 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_( \
0406 z, defaults_n, unused) \
0407 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (call)(defaults_n) )
0408
0409 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_( \
0410 z, defaults_n, unused) \
0411 , &BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)
0412
0413
0414 #define \
0415 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_( \
0416 id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
0417 BOOST_PP_LIST_FOR_EACH_I( \
0418 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
0419 ( id, typename01, 0 , 1 ), const_binds) \
0420 BOOST_PP_LIST_FOR_EACH_I( \
0421 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_PARAM_DECL_, \
0422 \
0423 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 ),\
0424 binds) \
0425 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
0426 has_const_bind_this), \
0427 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_PARAM_DECL_ \
0428 , \
0429 BOOST_PP_TUPLE_EAT(2) \
0430 )(id, typename01) \
0431 \
0432 BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
0433 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
0434 has_const_bind_this), \
0435 BOOST_PP_INC \
0436 , \
0437 BOOST_PP_TUPLE_REM(1) \
0438 )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, \
0439 binds)))), \
0440 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_PARAM_DECL_, ~)
0441
0442 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_( \
0443 id, typename01, \
0444 params, const_binds, has_const_bind_this, binds, has_bind_this) \
0445 operator()( \
0446 BOOST_PP_LIST_FOR_EACH_I( \
0447 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, ~, \
0448 params) \
0449 )
0450
0451 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_( \
0452 id, typename01, \
0453 params, const_binds, has_const_bind_this, binds, has_bind_this) \
0454 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_BODY_(id, typename01, \
0455 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
0456 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_PARAM_ENUM_, \
0457 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
0458 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_THIS_PARAM_, \
0459 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_ARG_NAME_ENUM_, \
0460 params, const_binds, has_const_bind_this, binds, has_bind_this)
0461
0462 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_(z, defaults_n, \
0463 id, typename01, decl_traits, params, \
0464 const_binds, has_const_bind_this, binds, has_bind_this) \
0465 inline static BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
0466 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_FUNC_(z, defaults_n, ~)( \
0467 void* object \
0468 BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS, \
0469 BOOST_PP_TUPLE_EAT(6) \
0470 , \
0471 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_BIND_PARAM_DECLS_ \
0472 )(id, typename01, \
0473 const_binds, has_const_bind_this, binds, has_bind_this) \
0474 BOOST_PP_LIST_FOR_EACH_I( \
0475 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_PARAM_ARG_DECL_, \
0476 typename01, params) \
0477 ) { \
0478 \
0479 \
0480 \
0481 \
0482 \
0483 \
0484 \
0485 \
0486 return \
0487 static_cast< \
0488 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)* \
0489 >(object)-> \
0490 BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
0491 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_OPERATOR_ \
0492 , \
0493 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_BODY_ \
0494 )(id, typename01, params, \
0495 const_binds, has_const_bind_this, binds, has_bind_this) \
0496 ; \
0497 }
0498
0499 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_(z, defaults_n, \
0500 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0501 BOOST_PP_EXPAND( \
0502 BOOST_PP_TUPLE_ELEM(9, 0, \
0503 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0504 ( z, defaults_n \
0505 , BOOST_PP_TUPLE_ELEM(9, 1, \
0506 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0507 , BOOST_PP_TUPLE_ELEM(9, 2, \
0508 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0509 , BOOST_PP_TUPLE_ELEM(9, 3, \
0510 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0511 , BOOST_PP_LIST_FIRST_N( \
0512 BOOST_PP_SUB(BOOST_PP_LIST_SIZE(BOOST_PP_TUPLE_ELEM(9, 4, \
0513 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis)),\
0514 defaults_n) \
0515 , BOOST_PP_TUPLE_ELEM(9, 4, \
0516 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0517 ) \
0518 , BOOST_PP_TUPLE_ELEM(9, 5, \
0519 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0520 , BOOST_PP_TUPLE_ELEM(9, 6, \
0521 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0522 , BOOST_PP_TUPLE_ELEM(9, 7, \
0523 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0524 , BOOST_PP_TUPLE_ELEM(9, 8, \
0525 op_id_typename_decl_params_constbinds_hasconstthis_binds_hasthis) \
0526 ) \
0527 )
0528
0529
0530
0531
0532 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_( \
0533 id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
0534 BOOST_PP_LIST_FOR_EACH_I( \
0535 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
0536 ( id, typename01, 0 , 1 ), \
0537 const_binds) \
0538 BOOST_PP_LIST_FOR_EACH_I( \
0539 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_BIND_TYPE_, \
0540 \
0541 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 ),\
0542 binds) \
0543 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
0544 has_const_bind_this), \
0545 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_THIS_TYPE_ \
0546 , \
0547 BOOST_PP_TUPLE_EAT(2) \
0548 )(id, typename01) \
0549 \
0550 BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
0551 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
0552 BOOST_PP_INC \
0553 , \
0554 BOOST_PP_TUPLE_REM(1) \
0555 )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
0556 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_TYPE_, ~)
0557
0558 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
0559 id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
0560 \
0561 \
0562 \
0563 \
0564 \
0565 \
0566 BOOST_PP_LIST_FOR_EACH_I( \
0567 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_,\
0568 (id, typename01, 0 , 1 ), \
0569 const_binds) \
0570 \
0571 BOOST_PP_LIST_FOR_EACH_I( \
0572 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_TYPEDEF_, \
0573 \
0574 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
0575 0 ), binds) \
0576 \
0577 BOOST_PP_EXPR_IIF(has_const_bind_this, \
0578 typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
0579 BOOST_PP_EXPR_IIF(typename01, typename) \
0580 ::boost::local_function::aux::add_pointed_const< \
0581 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
0582 >::type \
0583 this_ \
0584 ) ; \
0585 ) \
0586 \
0587 BOOST_PP_EXPR_IIF(has_bind_this, \
0588 typedef BOOST_LOCAL_FUNCTION_AUX_TYPEOF_TYPE( \
0589 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
0590 this_ \
0591 ) ; \
0592 )
0593
0594 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_( \
0595 id, typename01, const_binds, has_const_bind_this, binds, has_bind_this)\
0596 \
0597 \
0598 \
0599 BOOST_PP_LIST_FOR_EACH_I( \
0600 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_,\
0601 ( id, typename01, 0 , 1 ), \
0602 const_binds) \
0603 BOOST_PP_LIST_FOR_EACH_I( \
0604 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_DECL_,\
0605 \
0606 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
0607 0 ), binds) \
0608 \
0609 \
0610 BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
0611 \
0612 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, typename01) \
0613 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_ \
0614 ; \
0615 )
0616
0617 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_( \
0618 id, typename01, \
0619 const_binds, has_const_bind_this, binds, has_bind_this) \
0620 BOOST_PP_LIST_FOR_EACH_I( \
0621 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
0622 ( id, typename01, 0 , 1 ), const_binds) \
0623 BOOST_PP_LIST_FOR_EACH_I( \
0624 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_MAYBECONST_STATIC_BIND_MEMBER_, \
0625 \
0626 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), 0 ), \
0627 binds) \
0628 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, \
0629 has_const_bind_this), \
0630 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BIND_MEMBER_THIS_ \
0631 , \
0632 BOOST_PP_TUPLE_EAT(1) \
0633 )(id) \
0634 \
0635 BOOST_PP_REPEAT(BOOST_PP_SUB(BOOST_LOCAL_FUNCTION_CONFIG_BIND_MAX, \
0636 BOOST_PP_IIF(BOOST_PP_BITOR(has_bind_this, has_const_bind_this), \
0637 BOOST_PP_INC \
0638 , \
0639 BOOST_PP_TUPLE_REM(1) \
0640 )(BOOST_PP_LIST_SIZE(BOOST_PP_LIST_APPEND(const_binds, binds)))), \
0641 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_NOBIND_, ~)
0642
0643
0644
0645 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MEMBER_INITS_(id, typename01, \
0646 const_binds, has_const_bind_this, binds, has_bind_this) \
0647 BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(BOOST_PP_BITOR(BOOST_PP_BITOR( \
0648 BOOST_PP_LIST_IS_CONS(const_binds), BOOST_PP_LIST_IS_CONS(binds)), \
0649 has_bind_this), has_const_bind_this), \
0650 : \
0651 ) \
0652 \
0653 BOOST_PP_LIST_FOR_EACH_I( \
0654 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
0655 ( id, 0 ), const_binds) \
0656 \
0657 BOOST_PP_COMMA_IF( \
0658 BOOST_PP_BITAND( \
0659 BOOST_PP_LIST_IS_CONS(const_binds) \
0660 , BOOST_PP_LIST_IS_CONS(binds) \
0661 ) \
0662 ) \
0663 BOOST_PP_LIST_FOR_EACH_I( \
0664 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_MEMBER_INIT_ENUM_, \
0665 \
0666 ( id, BOOST_PP_LIST_SIZE(const_binds) ), binds) \
0667 \
0668 BOOST_PP_COMMA_IF( \
0669 BOOST_PP_BITAND( \
0670 BOOST_PP_BITOR( \
0671 BOOST_PP_LIST_IS_CONS(const_binds) \
0672 , BOOST_PP_LIST_IS_CONS(binds) \
0673 ) \
0674 , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
0675 ) \
0676 ) \
0677 BOOST_PP_EXPR_IIF(BOOST_PP_BITOR(has_const_bind_this, has_bind_this), \
0678 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_THIS_( \
0679 static_cast< BOOST_SCOPE_EXIT_DETAIL_PARAMS_T(id)* >( \
0680 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_)-> \
0681 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_VAR \
0682 ) \
0683 )
0684
0685
0686
0687 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_( \
0688 id, typename01, decl_traits, params, \
0689 default_count, const_binds, has_const_bind_this, binds, has_bind_this) \
0690 typedef class BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id) \
0691 \
0692 { \
0693 \
0694 private: \
0695 typedef \
0696 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_(id, typename01, \
0697 decl_traits, 1 , \
0698 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_) \
0699 ; \
0700 \
0701 \
0702 \
0703 \
0704 public: \
0705 typedef BOOST_PP_EXPR_IIF(typename01, typename) \
0706 BOOST_IDENTITY_TYPE(( \
0707 ::boost::local_function::aux::function< \
0708 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ \
0709 , default_count \
0710 BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
0711 BOOST_PP_TUPLE_EAT(6) \
0712 , \
0713 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_BIND_TYPES_\
0714 )(id, typename01, const_binds, has_const_bind_this, \
0715 binds, has_bind_this) \
0716 > \
0717 )) \
0718 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
0719 ; \
0720 private: \
0721 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_TYPEOF_TYPEDEFS_( \
0722 id, typename01, \
0723 const_binds, has_const_bind_this, binds, has_bind_this) \
0724 public: \
0725 \
0726 \
0727 enum { arity = ::boost::function_traits< \
0728 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_F_TYPE_ >::arity }; \
0729 typedef BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
0730 result_type; \
0731 BOOST_PP_LIST_FOR_EACH_I( \
0732 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_ARG_TYPEDEF_, \
0733 typename01, params) \
0734 \
0735 inline explicit BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CLASS_TYPE_(id)( \
0736 void* BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAMS_) \
0737 \
0738 \
0739 \
0740 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MEMBER_INITS_(id, typename01,\
0741 const_binds, has_const_bind_this, binds, has_bind_this) \
0742 { } \
0743 \
0744 \
0745 \
0746 BOOST_PP_REPEAT( \
0747 \
0748 BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
0749 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
0750 ( BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_, id, typename01 \
0751 , decl_traits, params, const_binds, has_const_bind_this, binds \
0752 , has_bind_this ) ) \
0753 \
0754 \
0755 \
0756 \
0757 \
0758 \
0759 \
0760 \
0761 \
0762 BOOST_PP_REPEAT( \
0763 \
0764 BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
0765 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_CALL_FOR_DEFAULTS_,\
0766 ( BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_, id \
0767 , typename01, decl_traits, params, const_binds \
0768 , has_const_bind_this, binds, has_bind_this ) ) \
0769 inline static void BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
0770 void* object \
0771 , BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE& functor \
0772 ) { \
0773 functor.BOOST_LOCAL_FUNCTION_AUX_FUNCTION_INIT_CALL_FUNC( \
0774 object \
0775 BOOST_PP_IIF(BOOST_LOCAL_FUNCTION_CONFIG_LOCALS_AS_TPARAMS,\
0776 BOOST_PP_TUPLE_EAT(6) \
0777 , \
0778 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_COMMA_STATIC_BINDS_ \
0779 )(id, typename01, const_binds, has_const_bind_this, \
0780 binds, has_bind_this) \
0781 BOOST_PP_REPEAT( \
0782 BOOST_PP_EXPAND(BOOST_PP_INC(default_count)), \
0783 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_STATIC_CALL_COMMA_FUNC_ADDR_, \
0784 ~) \
0785 ); \
0786 } \
0787 private: \
0788 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BIND_MEMBER_DECLS_(id, \
0789 typename01, const_binds, has_const_bind_this, binds, \
0790 has_bind_this) \
0791 \
0792 \
0793 \
0794 \
0795 boost::scope_exit::detail::undeclared \
0796 BOOST_LOCAL_FUNCTION_AUX_DECL_ARGS_VAR; \
0797 \
0798 \
0799 \
0800 inline BOOST_LOCAL_FUNCTION_AUX_CODE_RESULT_TYPE(id, typename01) \
0801 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_BODY_FUNC_( \
0802 \
0803 BOOST_PP_LIST_FOR_EACH_I( \
0804 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_, \
0805 ( id, typename01, 0 , 1 ), \
0806 const_binds) \
0807 \
0808 BOOST_PP_COMMA_IF( \
0809 BOOST_PP_BITAND( \
0810 BOOST_PP_LIST_IS_CONS(const_binds) \
0811 , BOOST_PP_LIST_IS_CONS(binds) \
0812 ) \
0813 ) \
0814 BOOST_PP_LIST_FOR_EACH_I( \
0815 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_MAYBECONST_BIND_DECL_ENUM_, \
0816 \
0817 ( id, typename01, BOOST_PP_LIST_SIZE(const_binds), \
0818 0 ), binds) \
0819 \
0820 BOOST_PP_COMMA_IF( \
0821 BOOST_PP_BITAND( \
0822 BOOST_PP_BITOR( \
0823 BOOST_PP_LIST_IS_CONS(const_binds) \
0824 , BOOST_PP_LIST_IS_CONS(binds) \
0825 ) \
0826 , BOOST_PP_BITOR(has_const_bind_this, has_bind_this) \
0827 ) \
0828 ) \
0829 \
0830 BOOST_PP_EXPR_IIF(has_const_bind_this, \
0831 BOOST_PP_EXPR_IIF(typename01, typename) \
0832 ::boost::local_function::aux::add_pointed_const< \
0833 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
0834 typename01) \
0835 >::type \
0836 const this_ \
0837 ) \
0838 \
0839 BOOST_PP_EXPR_IIF(has_bind_this, \
0840 BOOST_LOCAL_FUNCTION_AUX_CODE_BIND_THIS_TYPE(id, \
0841 typename01) \
0842 const this_ \
0843 ) \
0844 \
0845 BOOST_PP_COMMA_IF( \
0846 BOOST_PP_BITAND( \
0847 BOOST_PP_BITOR( \
0848 BOOST_PP_BITOR( \
0849 BOOST_PP_LIST_IS_CONS(const_binds) \
0850 , BOOST_PP_LIST_IS_CONS(binds) \
0851 ) \
0852 , BOOST_PP_BITOR(has_const_bind_this, \
0853 has_bind_this) \
0854 ) \
0855 , BOOST_PP_LIST_IS_CONS(params) \
0856 ) \
0857 ) \
0858 BOOST_PP_LIST_FOR_EACH_I( \
0859 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_PARAM_DECL_ENUM_, \
0860 1 , params) \
0861 ) \
0862 \
0863 \
0864
0865
0866
0867
0868 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_TYPE \
0869 BOOST_LOCAL_FUNCTION_AUX_SYMBOL( (functor_type) )
0870
0871 #define BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR(id, typename01, decl_traits) \
0872 BOOST_LOCAL_FUNCTION_AUX_CODE_FUNCTOR_(id, typename01, decl_traits \
0873 \
0874 , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS(decl_traits) \
0875 , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_PARAMS_DEFAULT_COUNT( \
0876 decl_traits) \
0877 \
0878 , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BINDS(decl_traits) \
0879 \
0880 , BOOST_PP_LIST_IS_CONS( \
0881 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_CONST_BIND_THIS_TYPES( \
0882 decl_traits)) \
0883 \
0884 , BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BINDS(decl_traits) \
0885 \
0886 , BOOST_PP_LIST_IS_CONS( \
0887 BOOST_LOCAL_FUNCTION_AUX_PP_DECL_TRAITS_BIND_THIS_TYPES( \
0888 decl_traits)) \
0889 )
0890
0891 #endif
0892