File indexing completed on 2024-11-15 09:22:52
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
0009 #define BOOST_PHOENIX_FUNCTION_ADAPT_CALLABLE_HPP
0010
0011 #include <boost/phoenix/core/limits.hpp>
0012 #include <boost/phoenix/core/detail/function_eval.hpp>
0013 #include <boost/preprocessor/repetition/repeat.hpp>
0014
0015 #define BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \
0016 inline \
0017 boost::phoenix::detail::expression::function_eval<FUNC>::type const \
0018 NAME() \
0019 { \
0020 return boost::phoenix::detail::expression:: \
0021 function_eval<FUNC>::make(FUNC()); \
0022 } \
0023
0024
0025
0026 #define BOOST_PHOENIX_ADAPT_CALLABLE(NAME, FUNC, N) \
0027 template <BOOST_PHOENIX_typename_A(N)> \
0028 inline \
0029 typename \
0030 boost::phoenix::detail::expression::function_eval< \
0031 FUNC \
0032 , BOOST_PHOENIX_A(N)>::type const \
0033 NAME(BOOST_PHOENIX_A_const_ref_a(N)) \
0034 { \
0035 return boost::phoenix::detail::expression:: \
0036 function_eval<FUNC, BOOST_PHOENIX_A(N)>:: \
0037 make(FUNC(), BOOST_PHOENIX_a(N)); \
0038 } \
0039
0040
0041
0042 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG(NAME, FUNC) \
0043 BOOST_PHOENIX_ADAPT_CALLABLE_NULLARY(NAME, FUNC) \
0044 BOOST_PP_REPEAT_FROM_TO( \
0045 1 \
0046 , BOOST_PHOENIX_LIMIT \
0047 , BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R \
0048 , (NAME, FUNC) \
0049 ) \
0050
0051
0052 #define BOOST_PHOENIX_ADAPT_CALLABLE_VARARG_R(Z, N, D) \
0053 BOOST_PHOENIX_ADAPT_CALLABLE( \
0054 BOOST_PP_TUPLE_ELEM(2, 0, D) \
0055 , BOOST_PP_TUPLE_ELEM(2, 1, D) \
0056 , N \
0057 ) \
0058
0059
0060 #endif