Chris@16
|
1 /*=============================================================================
|
Chris@16
|
2 Copyright (c) 2001-2007 Joel de Guzman
|
Chris@16
|
3
|
Chris@16
|
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
|
Chris@16
|
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
6 ==============================================================================*/
|
Chris@16
|
7 #ifndef PHOENIX_OPERATOR_COMPARISON_HPP
|
Chris@16
|
8 #define PHOENIX_OPERATOR_COMPARISON_HPP
|
Chris@16
|
9
|
Chris@16
|
10 #include <boost/spirit/home/phoenix/core/composite.hpp>
|
Chris@16
|
11 #include <boost/spirit/home/phoenix/core/compose.hpp>
|
Chris@16
|
12 #include <boost/spirit/home/phoenix/detail/type_deduction.hpp>
|
Chris@16
|
13 #include <boost/spirit/home/phoenix/operator/detail/unary_eval.hpp>
|
Chris@16
|
14 #include <boost/spirit/home/phoenix/operator/detail/unary_compose.hpp>
|
Chris@16
|
15 #include <boost/spirit/home/phoenix/operator/detail/binary_eval.hpp>
|
Chris@16
|
16 #include <boost/spirit/home/phoenix/operator/detail/binary_compose.hpp>
|
Chris@16
|
17
|
Chris@16
|
18 namespace boost { namespace phoenix
|
Chris@16
|
19 {
|
Chris@16
|
20 struct equal_to_eval;
|
Chris@16
|
21 struct not_equal_to_eval;
|
Chris@16
|
22 struct less_eval;
|
Chris@16
|
23 struct less_equal_eval;
|
Chris@16
|
24 struct greater_eval;
|
Chris@16
|
25 struct greater_equal_eval;
|
Chris@16
|
26
|
Chris@16
|
27 BOOST_BINARY_RESULT_OF(x == y, result_of_equal_to)
|
Chris@16
|
28 BOOST_BINARY_RESULT_OF(x != y, result_of_not_equal_to)
|
Chris@16
|
29 BOOST_BINARY_RESULT_OF(x < y, result_of_less)
|
Chris@16
|
30 BOOST_BINARY_RESULT_OF(x <= y, result_of_less_equal)
|
Chris@16
|
31 BOOST_BINARY_RESULT_OF(x > y, result_of_greater)
|
Chris@16
|
32 BOOST_BINARY_RESULT_OF(x >= y, result_of_greater_equal)
|
Chris@16
|
33
|
Chris@16
|
34 #define x a0.eval(env)
|
Chris@16
|
35 #define y a1.eval(env)
|
Chris@16
|
36
|
Chris@16
|
37 PHOENIX_BINARY_EVAL(equal_to_eval, result_of_equal_to, x == y)
|
Chris@16
|
38 PHOENIX_BINARY_EVAL(not_equal_to_eval, result_of_not_equal_to, x != y)
|
Chris@16
|
39 PHOENIX_BINARY_EVAL(less_eval, result_of_less, x < y)
|
Chris@16
|
40 PHOENIX_BINARY_EVAL(less_equal_eval, result_of_less_equal, x <= y)
|
Chris@16
|
41 PHOENIX_BINARY_EVAL(greater_eval, result_of_greater, x > y)
|
Chris@16
|
42 PHOENIX_BINARY_EVAL(greater_equal_eval, result_of_greater_equal, x >= y)
|
Chris@16
|
43
|
Chris@16
|
44 PHOENIX_BINARY_COMPOSE(equal_to_eval, ==)
|
Chris@16
|
45 PHOENIX_BINARY_COMPOSE(not_equal_to_eval, !=)
|
Chris@16
|
46 PHOENIX_BINARY_COMPOSE(less_eval, <)
|
Chris@16
|
47 PHOENIX_BINARY_COMPOSE(less_equal_eval, <=)
|
Chris@16
|
48 PHOENIX_BINARY_COMPOSE(greater_eval, >)
|
Chris@16
|
49 PHOENIX_BINARY_COMPOSE(greater_equal_eval, >=)
|
Chris@16
|
50
|
Chris@16
|
51 #undef x
|
Chris@16
|
52 #undef y
|
Chris@16
|
53 }}
|
Chris@16
|
54
|
Chris@16
|
55 #endif
|