123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251 |
- /*=============================================================================
- Copyright (c) 2001-2007 Joel de Guzman
- Copyright (c) 2014 John Fletcher
- 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
- #include <boost/utility/enable_if.hpp>
- #include <boost/type_traits/is_member_function_pointer.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/cpp03/member_function_ptr.hpp>
- namespace boost { namespace phoenix
- {
- template <typename RT, typename ClassT, typename ClassA>
- inline
- typename boost::lazy_enable_if<
- boost::is_member_function_pointer<RT (ClassT::*)()>,
- 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 boost::lazy_enable_if<
- boost::is_member_function_pointer<RT (ClassT::*)()>,
- 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/detail/cpp03/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/detail/cpp03/bind_member_function.hpp>))
- #include BOOST_PHOENIX_ITERATE()
- #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
- #pragma wave option(output: null)
- #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
|