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 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 
0008 #if !BOOST_PHOENIX_IS_ITERATING
0009 
0010 #include <boost/phoenix/core/limits.hpp>
0011 #include <boost/phoenix/support/iterate.hpp>
0012 
0013 namespace boost { namespace phoenix { namespace detail
0014 {
0015     template <int N, typename Dummy = void>
0016     struct function_ptr_impl
0017     {
0018         template <typename RT, typename FP>
0019         struct impl;
0020     };
0021 
0022     template <int N, typename RT, typename FP>
0023     struct function_ptr : function_ptr_impl<N>::template impl<RT, FP>
0024     {
0025         typedef typename function_ptr_impl<N>::template impl<RT, FP> base;
0026 
0027         function_ptr(FP fp_)
0028             : base(fp_) {}
0029         
0030         using base::fp;
0031 
0032         bool operator==(function_ptr const & rhs) const
0033         {
0034             return fp == rhs.fp;
0035         }
0036 
0037         template <int M, typename RhsRT, typename RhsFP>
0038         bool operator==(function_ptr<M, RhsRT, RhsFP> const & /*rhs*/) const
0039         {
0040             return false;
0041         }
0042 
0043     };
0044 
0045     template <typename Dummy>
0046     struct function_ptr_impl<0, Dummy>
0047     {
0048         template <typename RT, typename FP>
0049         struct impl
0050         {
0051             typedef RT result_type;
0052 
0053             impl(FP fp_)
0054                 : fp(fp_) {}
0055 
0056             RT operator()() const
0057             {
0058                 return fp();
0059             }
0060 
0061             FP fp;
0062         };
0063     };
0064 
0065     template <typename Dummy>
0066     struct function_ptr_impl<1, Dummy>
0067     {
0068         template <typename RT, typename FP>
0069         struct impl
0070         {
0071             typedef RT result_type;
0072 
0073             impl(FP fp_)
0074                 : fp(fp_) {}
0075 
0076             template <typename A>
0077             RT operator()(A &a) const
0078             {
0079                 return fp(a);
0080             }
0081 
0082             FP fp;
0083         };
0084     };
0085 
0086 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
0087     #include <boost/phoenix/bind/detail/cpp03/preprocessed/function_ptr.hpp>
0088 #else
0089 
0090 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0091     #pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_ptr_" BOOST_PHOENIX_LIMIT_STR ".hpp")
0092 #endif
0093 
0094 /*=============================================================================
0095     Copyright (c) 2001-2007 Joel de Guzman
0096 
0097     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0098     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0099 ==============================================================================*/
0100 
0101 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0102     #pragma wave option(preserve: 1)
0103 #endif
0104 
0105 #define BOOST_PHOENIX_ITERATION_PARAMS                                          \
0106     (3, (2, BOOST_PHOENIX_COMPOSITE_LIMIT,                                      \
0107     <boost/phoenix/bind/detail/cpp03/function_ptr.hpp>))
0108 #include BOOST_PHOENIX_ITERATE()
0109 
0110 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
0111     #pragma wave option(output: null)
0112 #endif
0113 
0114 #endif
0115 
0116 }}} // namespace boost::phoenix::detail
0117 
0118 ///////////////////////////////////////////////////////////////////////////////
0119 //
0120 //  Preprocessor vertical repetition code
0121 //
0122 ///////////////////////////////////////////////////////////////////////////////
0123 #else // defined(BOOST_PP_IS_ITERATING)
0124 
0125     template <typename Dummy>
0126     struct function_ptr_impl<BOOST_PHOENIX_ITERATION, Dummy>
0127     {
0128         template <typename RT, typename FP>
0129         struct impl
0130         {
0131             typedef RT result_type;
0132 
0133             impl(FP fp_)
0134                 : fp(fp_) {}
0135 
0136             template <BOOST_PHOENIX_typename_A>
0137             RT operator()(BOOST_PHOENIX_A_ref_a) const
0138             {
0139                 return fp(BOOST_PHOENIX_a);
0140             }
0141 
0142             FP fp;
0143         };
0144     };
0145 
0146 #endif // defined(BOOST_PP_IS_ITERATING)