1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
8 #if !BOOST_PHOENIX_IS_ITERATING
10 #include <boost/phoenix/core/limits.hpp>
11 #include <boost/phoenix/support/iterate.hpp>
13 namespace boost { namespace phoenix { namespace detail
15 template <int N, typename Dummy = void>
16 struct function_ptr_impl
18 template <typename RT, typename FP>
22 template <int N, typename RT, typename FP>
23 struct function_ptr : function_ptr_impl<N>::template impl<RT, FP>
25 typedef typename function_ptr_impl<N>::template impl<RT, FP> base;
32 bool operator==(function_ptr const & rhs) const
37 template <int M, typename RhsRT, typename RhsFP>
38 bool operator==(function_ptr<M, RhsRT, RhsFP> const & /*rhs*/) const
45 template <typename Dummy>
46 struct function_ptr_impl<0, Dummy>
48 template <typename RT, typename FP>
51 typedef RT result_type;
65 template <typename Dummy>
66 struct function_ptr_impl<1, Dummy>
68 template <typename RT, typename FP>
71 typedef RT result_type;
77 RT operator()(A &a) const
86 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
87 #include <boost/phoenix/bind/detail/cpp03/preprocessed/function_ptr.hpp>
90 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
91 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_ptr_" BOOST_PHOENIX_LIMIT_STR ".hpp")
94 /*=============================================================================
95 Copyright (c) 2001-2007 Joel de Guzman
97 Distributed under the Boost Software License, Version 1.0. (See accompanying
98 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
99 ==============================================================================*/
101 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
102 #pragma wave option(preserve: 1)
105 #define BOOST_PHOENIX_ITERATION_PARAMS \
106 (3, (2, BOOST_PHOENIX_COMPOSITE_LIMIT, \
107 <boost/phoenix/bind/detail/cpp03/function_ptr.hpp>))
108 #include BOOST_PHOENIX_ITERATE()
110 #if defined(__WAVE__) && defined (BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
111 #pragma wave option(output: null)
116 }}} // namespace boost::phoenix::detail
118 ///////////////////////////////////////////////////////////////////////////////
120 // Preprocessor vertical repetition code
122 ///////////////////////////////////////////////////////////////////////////////
123 #else // defined(BOOST_PP_IS_ITERATING)
125 template <typename Dummy>
126 struct function_ptr_impl<BOOST_PHOENIX_ITERATION, Dummy>
128 template <typename RT, typename FP>
131 typedef RT result_type;
136 template <BOOST_PHOENIX_typename_A>
137 RT operator()(BOOST_PHOENIX_A_ref_a) const
139 return fp(BOOST_PHOENIX_a);
146 #endif // defined(BOOST_PP_IS_ITERATING)