next_impl.hpp 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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_NEXT_IMPL_05042005_1058)
  7. #define FUSION_NEXT_IMPL_05042005_1058
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/container/vector/vector_iterator.hpp>
  10. namespace boost { namespace fusion
  11. {
  12. struct vector_iterator_tag;
  13. template <typename Vector, int N>
  14. struct vector_iterator;
  15. namespace extension
  16. {
  17. template <typename Tag>
  18. struct next_impl;
  19. template <>
  20. struct next_impl<vector_iterator_tag>
  21. {
  22. template <typename Iterator>
  23. struct apply
  24. {
  25. typedef typename Iterator::vector vector;
  26. typedef typename Iterator::index index;
  27. typedef vector_iterator<vector, index::value+1> type;
  28. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  29. static type
  30. call(Iterator const& i)
  31. {
  32. return type(i.vec);
  33. }
  34. };
  35. };
  36. }
  37. }}
  38. #endif