lazy.hpp 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  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. #if !defined(BOOST_SPIRIT_LAZY_NOVEMBER_04_2008_1157AM)
  7. #define BOOST_SPIRIT_LAZY_NOVEMBER_04_2008_1157AM
  8. #if defined(_MSC_VER)
  9. #pragma once
  10. #endif
  11. #include <boost/spirit/home/support/modify.hpp>
  12. #include <boost/spirit/home/support/detail/is_spirit_tag.hpp>
  13. #include <boost/proto/traits.hpp>
  14. namespace boost { namespace phoenix
  15. {
  16. template <typename Expr>
  17. struct actor;
  18. }}
  19. namespace boost { namespace spirit
  20. {
  21. template <typename Eval>
  22. typename proto::terminal<phoenix::actor<Eval> >::type
  23. lazy(phoenix::actor<Eval> const& f)
  24. {
  25. return proto::terminal<phoenix::actor<Eval> >::type::make(f);
  26. }
  27. namespace tag
  28. {
  29. struct lazy_eval
  30. {
  31. BOOST_SPIRIT_IS_TAG()
  32. };
  33. }
  34. template <typename Domain>
  35. struct is_modifier_directive<Domain, tag::lazy_eval>
  36. : mpl::true_ {};
  37. }}
  38. #endif