prior_impl.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*=============================================================================
  2. Copyright (c) 2011 Eric Niebler
  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_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM)
  7. #define BOOST_FUSION_SINGLE_VIEW_PRIOR_IMPL_JUL_07_2011_1348PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/mpl/prior.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct single_view_iterator_tag;
  13. template <typename Sequence, typename Pos>
  14. struct single_view_iterator;
  15. namespace extension
  16. {
  17. template <typename Tag>
  18. struct prior_impl;
  19. template <>
  20. struct prior_impl<single_view_iterator_tag>
  21. {
  22. template <typename Iterator>
  23. struct apply
  24. {
  25. typedef single_view_iterator<
  26. typename Iterator::single_view_type,
  27. typename mpl::prior<typename Iterator::position>::type>
  28. type;
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type
  31. call(Iterator const& i)
  32. {
  33. return type(i.view);
  34. }
  35. };
  36. };
  37. }
  38. }}
  39. #endif