if_else.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*==============================================================================
  2. Copyright (c) 2001-2010 Joel de Guzman
  3. Copyright (c) 2010 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. #ifndef BOOST_PHOENIX_OPERATOR_IF_ELSE_HPP
  8. #define BOOST_PHOENIX_OPERATOR_IF_ELSE_HPP
  9. #include <boost/phoenix/core/limits.hpp>
  10. #include <boost/phoenix/core/meta_grammar.hpp>
  11. #include <boost/phoenix/core/expression.hpp>
  12. #include <boost/proto/operators.hpp>
  13. namespace boost { namespace phoenix
  14. {
  15. namespace tag
  16. {
  17. typedef proto::tag::if_else_ if_else_operator;
  18. }
  19. namespace expression
  20. {
  21. template <typename A0, typename A1, typename A2>
  22. struct if_else_operator
  23. : expr<tag::if_else_operator, A0, A1, A2>
  24. {};
  25. }
  26. namespace rule
  27. {
  28. struct if_else_operator
  29. : expression::if_else_operator<
  30. meta_grammar
  31. , meta_grammar
  32. , meta_grammar
  33. >
  34. {};
  35. }
  36. template <typename Dummy>
  37. struct meta_grammar::case_<tag::if_else_operator, Dummy>
  38. : enable_rule<rule::if_else_operator, Dummy>
  39. {};
  40. using proto::if_else;
  41. }}
  42. #endif