lazy.hpp 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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/include/phoenix_core.hpp>
  12. #include <boost/proto/proto.hpp>
  13. #include <boost/spirit/home/support/modify.hpp>
  14. #include <boost/spirit/home/support/detail/is_spirit_tag.hpp>
  15. namespace boost { namespace spirit
  16. {
  17. template <typename Eval>
  18. typename proto::terminal<phoenix::actor<Eval> >::type
  19. lazy(phoenix::actor<Eval> const& f)
  20. {
  21. return proto::terminal<phoenix::actor<Eval> >::type::make(f);
  22. }
  23. namespace tag
  24. {
  25. struct lazy_eval
  26. {
  27. BOOST_SPIRIT_IS_TAG()
  28. };
  29. }
  30. template <typename Domain>
  31. struct is_modifier_directive<Domain, tag::lazy_eval>
  32. : mpl::true_ {};
  33. }}
  34. #endif