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 ==============================================================================*/
7 #ifndef PHOENIX_OPERATOR_DETAIL_BINARY_EVAL_HPP
8 #define PHOENIX_OPERATOR_DETAIL_BINARY_EVAL_HPP
10 #include <boost/mpl/or.hpp>
11 #include <boost/mpl/eval_if.hpp>
12 #include <boost/mpl/identity.hpp>
13 #include <boost/type_traits/is_same.hpp>
14 #include <boost/spirit/home/phoenix/core/compose.hpp>
16 #define PHOENIX_BINARY_EVAL(eval_name, op_result, expr) \
19 template <typename Env, typename A0, typename A1> \
22 typedef typename A0::template result<Env>::type x_type; \
23 typedef typename A1::template result<Env>::type y_type; \
27 mpl::or_<is_actor<x_type>, is_actor<y_type> > \
28 , re_curry<eval_name, x_type, y_type> \
29 , op_result<x_type, y_type> \
34 template <typename RT, typename Env, typename A0, typename A1> \
36 eval(Env const& env, A0& a0, A1& a1) \