v2_eval.hpp 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*=============================================================================
  2. Copyright (c) 2011 Thomas Heller
  3. Distributed under the Boost Software License, Version 1.0. (See accompanying
  4. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. ==============================================================================*/
  6. #ifndef BOOST_PHOENIX_CORE_V2_EVAL_HPP
  7. #define BOOST_PHOENIX_CORE_V2_EVAL_HPP
  8. #include <boost/phoenix/core/limits.hpp>
  9. #include <boost/phoenix/core/environment.hpp>
  10. #include <boost/phoenix/core/is_actor.hpp>
  11. #include <boost/phoenix/core/meta_grammar.hpp>
  12. #include <boost/phoenix/core/terminal_fwd.hpp>
  13. #include <boost/phoenix/support/vector.hpp>
  14. #include <boost/proto/transform/fold.hpp>
  15. #include <boost/proto/transform/lazy.hpp>
  16. namespace boost { namespace phoenix
  17. {
  18. struct v2_eval
  19. : proto::callable
  20. {
  21. template <typename Sig>
  22. struct result;
  23. template <typename This, typename Eval, typename Env>
  24. struct result<This(Eval, Env)>
  25. : Eval::template result<typename proto::detail::uncvref<Env>::type>
  26. {};
  27. template <typename This, typename Eval, typename Env>
  28. struct result<This(Eval &, Env)>
  29. : Eval::template result<typename proto::detail::uncvref<Env>::type>
  30. {};
  31. template <typename This, typename Eval, typename Env>
  32. struct result<This(Eval const &, Env)>
  33. : Eval::template result<typename proto::detail::uncvref<Env>::type>
  34. {};
  35. template <typename Eval, typename Env>
  36. typename result<v2_eval(Eval const&, Env)>::type
  37. operator()(Eval const & e, Env const & env) const
  38. {
  39. return e.eval(env);
  40. }
  41. };
  42. }}
  43. #endif