advance_impl.hpp 1.3 KB

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