function_equal.hpp 4.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /*==============================================================================
  2. Copyright (c) 2005-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_CORE_DETAIL_FUNCTION_EQUAL_HPP
  8. #define BOOST_PHOENIX_CORE_DETAIL_FUNCTION_EQUAL_HPP
  9. #include <boost/preprocessor/arithmetic/inc.hpp>
  10. #include <boost/preprocessor/repetition/repeat_from_to.hpp>
  11. #if !defined(BOOST_PHOENIX_DONT_USE_PREPROCESSED_FILES)
  12. #include <boost/phoenix/core/detail/cpp03/preprocessed/function_equal.hpp>
  13. #else
  14. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  15. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/function_equal_" BOOST_PHOENIX_LIMIT_STR ".hpp")
  16. #endif
  17. /*==============================================================================
  18. Copyright (c) 2001-2010 Joel de Guzman
  19. Copyright (c) 2004 Daniel Wallin
  20. Copyright (c) 2010 Thomas Heller
  21. Distributed under the Boost Software License, Version 1.0. (See accompanying
  22. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  23. ==============================================================================*/
  24. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  25. #pragma wave option(preserve: 1)
  26. #endif
  27. #define BOOST_PHOENIX_FUNCTION_EQUAL_R(Z, N, DATA) \
  28. && function_equal_()( \
  29. proto::child_c< N >(e1) \
  30. , proto::child_c< N >(e2) \
  31. ) \
  32. /**/
  33. #define BOOST_PHOENIX_FUNCTION_EQUAL(Z, N, DATA) \
  34. template <typename Expr1> \
  35. result_type \
  36. evaluate( \
  37. Expr1 const& e1 \
  38. , Expr1 const& e2 \
  39. , mpl::long_< N > \
  40. ) const \
  41. { \
  42. return \
  43. function_equal_()( \
  44. proto::child_c<0>(e1) \
  45. , proto::child_c<0>(e2) \
  46. ) \
  47. BOOST_PP_REPEAT_FROM_TO( \
  48. 1 \
  49. , N \
  50. , BOOST_PHOENIX_FUNCTION_EQUAL_R \
  51. , _ \
  52. ); \
  53. } \
  54. /**/
  55. BOOST_PP_REPEAT_FROM_TO(
  56. 1
  57. , BOOST_PP_INC(BOOST_PROTO_MAX_ARITY)
  58. , BOOST_PHOENIX_FUNCTION_EQUAL
  59. , _
  60. )
  61. #undef BOOST_PHOENIX_FUNCTION_EQUAL_R
  62. #undef BOOST_PHOENIX_FUNCTION_EQUAL
  63. #if defined(__WAVE__) && defined(BOOST_PHOENIX_CREATE_PREPROCESSED_FILES)
  64. #pragma wave option(output: null)
  65. #endif
  66. #endif
  67. #endif