deref_impl.hpp 1.4 KB

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