Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-22 10:17:01

0001 /*=============================================================================
0002     Copyright (c) 2001-2007 Joel de Guzman
0003     Copyright (c) 2014      John Fletcher
0004 
0005     Distributed under the Boost Software License, Version 1.0. (See accompanying
0006     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0007 ==============================================================================*/
0008 
0009 #if !BOOST_PHOENIX_IS_ITERATING
0010 
0011 #include <boost/utility/enable_if.hpp>
0012 #include <boost/type_traits/is_member_function_pointer.hpp>
0013 #include <boost/phoenix/core/expression.hpp>
0014 #include <boost/phoenix/core/reference.hpp>
0015 #include <boost/phoenix/core/detail/function_eval.hpp>
0016 #include <boost/phoenix/bind/detail/cpp03/member_function_ptr.hpp>
0017 
0018 namespace boost { namespace phoenix
0019 {
0020 
0021     template <typename RT, typename ClassT, typename ClassA>
0022     inline
0023     typename boost::lazy_enable_if<
0024       boost::is_member_function_pointer<RT (ClassT::*)()>,
0025     typename detail::expression::function_eval<
0026             detail::member_function_ptr<0, RT, RT(ClassT::*)()>
0027           , ClassA >
0028     >::type const
0029     bind(RT(ClassT::*f)(), ClassA const& obj)
0030     {
0031         typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
0032         return
0033             detail::expression::function_eval<fp_type, ClassA>::make(
0034                 fp_type(f)
0035               , obj
0036             );
0037     }
0038 
0039     template <typename RT, typename ClassT, typename ClassA>
0040     inline
0041     typename boost::lazy_enable_if<
0042       boost::is_member_function_pointer<RT (ClassT::*)()>,
0043     typename detail::expression::function_eval<
0044             detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
0045           , ClassA >
0046     >::type const
0047     bind(RT(ClassT::*f)() const, ClassA const& obj)
0048     {
0049         typedef
0050             detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
0051             fp_type;
0052         return
0053             detail::expression::function_eval<fp_type, ClassA>::make(
0054                 fp_type(f)
0055               , obj
0056             );
0057     }
0058 
0059     template <typename RT, typename ClassT>
0060     inline
0061     typename detail::expression::function_eval<
0062             detail::member_function_ptr<0, RT, RT(ClassT::*)()>
0063           , ClassT
0064     >::type const
0065     bind(RT(ClassT::*f)(), ClassT& obj)
0066     {
0067         typedef detail::member_function_ptr<0, RT, RT(ClassT::*)()> fp_type;
0068         return
0069             detail::expression::function_eval<
0070                 fp_type
0071               , ClassT
0072             >::make(
0073                 fp_type(f)
0074               , obj
0075             );
0076     }
0077 
0078     template <typename RT, typename ClassT>
0079     inline
0080     typename detail::expression::function_eval<
0081             detail::member_function_ptr<0, RT, RT(ClassT::*)() const>
0082           , ClassT
0083     >::type const
0084     bind(RT(ClassT::*f)() const, ClassT& obj)
0085     {
0086         typedef detail::member_function_ptr<0, RT, RT(ClassT::*)() const> fp_type;
0087         return
0088             detail::expression::function_eval<
0089                 fp_type
0090               , ClassT
0091             >::make(
0092                 fp_type(f)
0093               , obj
0094             );
0095     }
0096 
0097 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
0098     #include <boost/phoenix/bind/detail/cpp03/preprocessed/bind_member_function.hpp>
0099 #else
0100 
0101 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0102     #pragma wave option(preserve: 2, line: 0, output: "preprocessed/bind_member_function_" BOOST_PHOENIX_LIMIT_STR ".hpp")
0103 #endif
0104 
0105 /*=============================================================================
0106     Copyright (c) 2001-2007 Joel de Guzman
0107 
0108     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0109     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0110 ==============================================================================*/
0111 
0112 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0113     #pragma wave option(preserve: 1)
0114 #endif
0115 
0116 #define BOOST_PHOENIX_ITERATION_PARAMS                                          \
0117     (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_ACTOR_LIMIT),                            \
0118             <boost/phoenix/bind/detail/cpp03/bind_member_function.hpp>))
0119 #include BOOST_PHOENIX_ITERATE()
0120 
0121 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0122     #pragma wave option(output: null)
0123 #endif
0124 
0125 #endif
0126 
0127 }}
0128 
0129 #else
0130 
0131     template <
0132         typename RT
0133       , typename ClassT
0134       , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
0135       , typename ClassA
0136       , BOOST_PHOENIX_typename_A
0137     >
0138     inline
0139     typename detail::expression::function_eval<
0140         detail::member_function_ptr<
0141             BOOST_PHOENIX_ITERATION
0142           , RT
0143           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0144         >
0145       , ClassA
0146       , BOOST_PHOENIX_A
0147     >::type const
0148     bind(
0149         RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0150       , ClassA const & obj
0151       , BOOST_PHOENIX_A_const_ref_a
0152     )
0153     {
0154         typedef detail::member_function_ptr<
0155             BOOST_PHOENIX_ITERATION
0156           , RT
0157           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0158         > fp_type;
0159         return
0160             detail::expression::function_eval<
0161                 fp_type
0162               , ClassA
0163               , BOOST_PHOENIX_A
0164             >::make(
0165                 fp_type(f)
0166               , obj
0167               , BOOST_PHOENIX_a
0168             );
0169     }
0170 
0171     template <
0172         typename RT
0173       , typename ClassT
0174       , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
0175       , typename ClassA
0176       , BOOST_PHOENIX_typename_A
0177     >
0178     inline
0179     typename detail::expression::function_eval<
0180         detail::member_function_ptr<
0181             BOOST_PHOENIX_ITERATION
0182           , RT
0183           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
0184         >
0185       , ClassA
0186       , BOOST_PHOENIX_A
0187     >::type const
0188     bind(
0189         RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
0190       , ClassA const & obj
0191       , BOOST_PHOENIX_A_const_ref_a
0192     )
0193     {
0194         typedef detail::member_function_ptr<
0195             BOOST_PHOENIX_ITERATION
0196           , RT
0197           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T)) const
0198         > fp_type;
0199         return
0200             detail::expression::function_eval<
0201                 fp_type
0202               , ClassA
0203               , BOOST_PHOENIX_A
0204             >::make(
0205                 fp_type(f)
0206               , obj
0207               , BOOST_PHOENIX_a
0208             );
0209     }
0210 
0211     template <
0212         typename RT
0213       , typename ClassT
0214       , BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, typename T)
0215       , BOOST_PHOENIX_typename_A
0216     >
0217     inline
0218     typename detail::expression::function_eval<
0219         detail::member_function_ptr<
0220             BOOST_PHOENIX_ITERATION
0221           , RT
0222           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0223         >
0224       , ClassT
0225       , BOOST_PHOENIX_A
0226     >::type const
0227     bind(
0228         RT(ClassT::*f)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0229       , ClassT & obj
0230       , BOOST_PHOENIX_A_const_ref_a
0231     )
0232     {
0233         typedef detail::member_function_ptr<
0234             BOOST_PHOENIX_ITERATION
0235           , RT
0236           , RT(ClassT::*)(BOOST_PP_ENUM_PARAMS(BOOST_PHOENIX_ITERATION, T))
0237         > fp_type;
0238         return
0239             detail::expression::function_eval<
0240                 fp_type
0241               , ClassT
0242               , BOOST_PHOENIX_A
0243             >::make(
0244                 fp_type(f)
0245               , obj
0246               , BOOST_PHOENIX_a
0247             );
0248     }
0249 
0250 #endif
0251