deref_data_impl.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. /*=============================================================================
  2. Copyright (c) 2009 Christopher Schmidt
  3. Copyright (c) 2021-2022 Denis Mikhailov
  4. Distributed under the Boost Software License, Version 1.0. (See accompanying
  5. file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. ==============================================================================*/
  7. #ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
  8. #define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP
  9. #include <boost/fusion/support/config.hpp>
  10. #include <boost/fusion/iterator/deref_data.hpp>
  11. #include <boost/fusion/iterator/prior.hpp>
  12. namespace boost { namespace fusion { namespace extension
  13. {
  14. template <typename>
  15. struct deref_data_impl;
  16. template <>
  17. struct deref_data_impl<reverse_view_iterator_tag>
  18. {
  19. template <typename It>
  20. struct apply
  21. {
  22. typedef typename
  23. result_of::deref_data<
  24. typename result_of::prior<
  25. typename It::first_type
  26. >::type
  27. >::type
  28. type;
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type
  31. call(It const& it)
  32. {
  33. return fusion::deref_data(fusion::prior(it.first));
  34. }
  35. };
  36. };
  37. }}}
  38. #endif