1 /*=============================================================================
2 Copyright (c) 2011 Thomas Heller
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 ==============================================================================*/
7 #if !BOOST_PHOENIX_IS_ITERATING
8 #ifndef BOOST_PHOENIX_CORE_DETAIL_PHX2_RESULT_HPP
9 #define BOOST_PHOENIX_CORE_DETAIL_PHX2_RESULT_HPP
10 #include <boost/phoenix/core/limits.hpp>
11 #include <boost/phoenix/support/iterate.hpp>
12 #include <boost/mpl/has_xxx.hpp>
14 namespace boost { namespace phoenix {
17 BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
19 template <typename Result>
20 struct has_phx2_result_impl
23 typedef char (&no)[2];
26 static yes check(typename A::type *);
32 static bool const value = (sizeof(yes) == sizeof(check<Result>(0)));
33 typedef boost::mpl::bool_<value> type;
36 template <typename F, BOOST_PHOENIX_typename_A_void(BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT)), typename Dummy = void>
37 struct has_phx2_result
41 template <typename F, BOOST_PHOENIX_typename_A_void(BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT)), typename Dummy = void>
43 #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
44 #include <boost/phoenix/core/detail/preprocessed/phx2_result.hpp>
46 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
47 #pragma wave option(preserve: 2, line: 0, output: "preprocessed/phx2_result_" BOOST_PHOENIX_LIMIT_STR ".hpp")
49 /*=============================================================================
50 Copyright (c) 2011 Thomas Heller
52 Distributed under the Boost Software License, Version 1.0. (See accompanying
53 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
54 ==============================================================================*/
55 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
56 #pragma wave option(preserve: 1)
60 #define BOOST_PHOENIX_ITERATION_PARAMS \
61 (3, (1, BOOST_PP_DEC(BOOST_PHOENIX_COMPOSITE_LIMIT), \
62 <boost/phoenix/core/detail/phx2_result.hpp>))
63 #include BOOST_PHOENIX_ITERATE()
65 #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
66 #pragma wave option(output: null)
77 template <typename F, BOOST_PHOENIX_typename_A>
78 struct has_phx2_result<F, BOOST_PHOENIX_A>
82 , has_phx2_result_impl<typename F::template result<F(BOOST_PHOENIX_A)> >
87 template <typename F, BOOST_PHOENIX_typename_A>
88 struct phx2_result<F, BOOST_PHOENIX_A>
90 typedef typename F::template result<BOOST_PHOENIX_A>::type type;
93 template <typename F, BOOST_PHOENIX_typename_A>
94 struct phx2_result<F, BOOST_PHOENIX_A_ref>
96 typedef typename F::template result<BOOST_PHOENIX_A>::type type;
99 template <typename F, BOOST_PHOENIX_typename_A>
100 struct phx2_result<F, BOOST_PHOENIX_A_const_ref>
102 typedef typename F::template result<BOOST_PHOENIX_A>::type type;