prior_impl.hpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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(FUSION_PRIOR_IMPL_07202005_0857)
  7. #define FUSION_PRIOR_IMPL_07202005_0857
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/next.hpp>
  10. #include <boost/fusion/iterator/prior.hpp>
  11. namespace boost { namespace fusion
  12. {
  13. struct reverse_view_iterator_tag;
  14. template <typename Iterator>
  15. struct reverse_view_iterator;
  16. namespace extension
  17. {
  18. template <>
  19. struct prior_impl<reverse_view_iterator_tag>
  20. {
  21. template <typename Iterator>
  22. struct apply
  23. {
  24. typedef typename Iterator::first_type first_type;
  25. typedef typename next_impl<typename first_type::fusion_tag>::
  26. template apply<first_type>
  27. wrapped;
  28. typedef reverse_view_iterator<typename wrapped::type> type;
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type
  31. call(Iterator const& i)
  32. {
  33. return type(wrapped::call(i.first));
  34. }
  35. };
  36. };
  37. }
  38. }}
  39. #endif