advance_impl.hpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /*=============================================================================
  2. Copyright (c) 2009 Hartmut Kaiser
  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_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM)
  7. #define BOOST_FUSION_NVIEW_ADVANCE_IMPL_SEP_24_2009_0212PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/iterator/advance.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct nview_iterator_tag;
  13. template <typename Sequence, typename Pos>
  14. struct nview_iterator;
  15. namespace extension
  16. {
  17. template<typename Tag>
  18. struct advance_impl;
  19. template<>
  20. struct advance_impl<nview_iterator_tag>
  21. {
  22. template<typename Iterator, typename Dist>
  23. struct apply
  24. {
  25. typedef typename Iterator::first_type iterator_type;
  26. typedef typename Iterator::sequence_type sequence_type;
  27. typedef nview_iterator<sequence_type,
  28. typename result_of::advance<iterator_type, Dist>::type> type;
  29. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  30. static type
  31. call(Iterator const& i)
  32. {
  33. return type(i.seq);
  34. }
  35. };
  36. };
  37. }
  38. }}
  39. #endif