next_impl.hpp 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*=============================================================================
  2. Copyright (c) 2001-2011 Joel de Guzman
  3. Copyright (c) 2006 Dan Marsden
  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. #if !defined(BOOST_FUSION_NEXT_IMPL_20060222_1859)
  8. #define BOOST_FUSION_NEXT_IMPL_20060222_1859
  9. namespace example
  10. {
  11. struct example_struct_iterator_tag;
  12. template<typename Struct, int Pos>
  13. struct example_struct_iterator;
  14. }
  15. namespace boost { namespace fusion {
  16. namespace extension
  17. {
  18. template<typename Tag>
  19. struct next_impl;
  20. template<>
  21. struct next_impl<example::example_struct_iterator_tag>
  22. {
  23. template<typename Iterator>
  24. struct apply
  25. {
  26. typedef typename Iterator::struct_type struct_type;
  27. typedef typename Iterator::index index;
  28. typedef example::example_struct_iterator<struct_type, index::value + 1> type;
  29. static type
  30. call(Iterator const& i)
  31. {
  32. return type(i.struct_);
  33. }
  34. };
  35. };
  36. }
  37. }}
  38. #endif