PageRenderTime 116ms CodeModel.GetById 14ms app.highlight 84ms RepoModel.GetById 1ms app.codeStats 17ms

/Src/Dependencies/Boost/boost/spirit/home/phoenix/operator/logical.hpp

http://hadesmem.googlecode.com/
C++ Header | 43 lines | 29 code | 8 blank | 6 comment | 4 complexity | 6f68558695fe0e70626675243872a4f9 MD5 | raw file
 1/*=============================================================================
 2    Copyright (c) 2001-2007 Joel de Guzman
 3
 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_LOGICAL_HPP
 8#define PHOENIX_OPERATOR_LOGICAL_HPP
 9
10#include <boost/spirit/home/phoenix/core/composite.hpp>
11#include <boost/spirit/home/phoenix/core/compose.hpp>
12#include <boost/spirit/home/phoenix/detail/type_deduction.hpp>
13#include <boost/spirit/home/phoenix/operator/detail/unary_eval.hpp>
14#include <boost/spirit/home/phoenix/operator/detail/unary_compose.hpp>
15#include <boost/spirit/home/phoenix/operator/detail/binary_eval.hpp>
16#include <boost/spirit/home/phoenix/operator/detail/binary_compose.hpp>
17
18namespace boost { namespace phoenix
19{
20    struct logical_not_eval;
21    struct logical_and_eval;
22    struct logical_or_eval;
23
24    BOOST_UNARY_RESULT_OF(!x, result_of_logical_not)
25    BOOST_BINARY_RESULT_OF(x && y, result_of_logical_and)
26    BOOST_BINARY_RESULT_OF(x || y, result_of_logical_or)
27
28#define x a0.eval(env)
29#define y a1.eval(env)
30
31    PHOENIX_UNARY_EVAL(logical_not_eval, result_of_logical_not, !x)
32    PHOENIX_BINARY_EVAL(logical_and_eval, result_of_logical_and, x && y)
33    PHOENIX_BINARY_EVAL(logical_or_eval, result_of_logical_or, x || y)
34
35    PHOENIX_UNARY_COMPOSE(logical_not_eval, !)
36    PHOENIX_BINARY_COMPOSE(logical_and_eval, &&)
37    PHOENIX_BINARY_COMPOSE(logical_or_eval, ||)
38
39#undef x
40#undef y
41}}
42
43#endif