advance_impl.hpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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_ADVANCE_IMPL_20060222_2150)
  8. #define BOOST_FUSION_ADVANCE_IMPL_20060222_2150
  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 advance_impl;
  20. template<>
  21. struct advance_impl<example::example_struct_iterator_tag>
  22. {
  23. template<typename Iterator, typename N>
  24. struct apply
  25. {
  26. typedef typename Iterator::struct_type struct_type;
  27. typedef typename Iterator::index index;
  28. typedef example::example_struct_iterator<
  29. struct_type, index::value + N::value> type;
  30. static type
  31. call(Iterator const& it)
  32. {
  33. return type(it.struct_);
  34. }
  35. };
  36. };
  37. }
  38. }}
  39. #endif