null_eval.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #if !defined(BOOST_PROTO_DONT_USE_PREPROCESSED_FILES)
  2. #include <boost/proto/context/detail/preprocessed/null_eval.hpp>
  3. #elif !defined(BOOST_PP_IS_ITERATING)
  4. #define BOOST_PROTO_EVAL_N(Z, N, DATA) \
  5. proto::eval(proto::child_c<N>(expr), ctx); \
  6. /**/
  7. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  8. #pragma wave option(preserve: 2, line: 0, output: "preprocessed/null_eval.hpp")
  9. #endif
  10. ///////////////////////////////////////////////////////////////////////////////
  11. /// \file null_eval.hpp
  12. /// Contains specializations of the null_eval\<\> class template.
  13. //
  14. // Copyright 2008 Eric Niebler. Distributed under the Boost
  15. // Software License, Version 1.0. (See accompanying file
  16. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  17. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  18. #pragma wave option(preserve: 1)
  19. #endif
  20. #define BOOST_PP_ITERATION_PARAMS_1 \
  21. (3, (1, BOOST_PROTO_MAX_ARITY, <boost/proto/context/detail/null_eval.hpp>))
  22. #include BOOST_PP_ITERATE()
  23. #if defined(__WAVE__) && defined(BOOST_PROTO_CREATE_PREPROCESSED_FILES)
  24. #pragma wave option(output: null)
  25. #endif
  26. #undef BOOST_PROTO_EVAL_N
  27. #else
  28. #define N BOOST_PP_ITERATION()
  29. template<typename Expr, typename Context>
  30. struct null_eval<Expr, Context, N>
  31. {
  32. typedef void result_type;
  33. void operator ()(Expr &expr, Context &ctx) const
  34. {
  35. BOOST_PP_REPEAT(N, BOOST_PROTO_EVAL_N, ~)
  36. }
  37. };
  38. #undef N
  39. #endif