nview_iterator.hpp 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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_ITERATOR_SEP_23_2009_0948PM)
  7. #define BOOST_FUSION_NVIEW_ITERATOR_SEP_23_2009_0948PM
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/support/iterator_base.hpp>
  10. #include <boost/fusion/support/category_of.hpp>
  11. #include <boost/fusion/sequence/intrinsic/begin.hpp>
  12. #include <boost/fusion/sequence/intrinsic/end.hpp>
  13. #include <boost/fusion/view/nview/detail/size_impl.hpp>
  14. #include <boost/fusion/view/nview/detail/begin_impl.hpp>
  15. #include <boost/fusion/view/nview/detail/end_impl.hpp>
  16. #include <boost/fusion/view/nview/detail/deref_impl.hpp>
  17. #include <boost/fusion/view/nview/detail/value_of_impl.hpp>
  18. #include <boost/fusion/view/nview/detail/next_impl.hpp>
  19. #include <boost/fusion/view/nview/detail/prior_impl.hpp>
  20. #include <boost/fusion/view/nview/detail/at_impl.hpp>
  21. #include <boost/fusion/view/nview/detail/value_at_impl.hpp>
  22. #include <boost/fusion/view/nview/detail/advance_impl.hpp>
  23. #include <boost/fusion/view/nview/detail/distance_impl.hpp>
  24. #include <boost/fusion/view/nview/detail/equal_to_impl.hpp>
  25. #ifdef _MSC_VER
  26. # pragma warning(push)
  27. # pragma warning(disable: 4512) // assignment operator could not be generated.
  28. #endif
  29. namespace boost { namespace fusion
  30. {
  31. struct nview_iterator_tag;
  32. struct random_access_traversal_tag;
  33. template<typename Sequence, typename Pos>
  34. struct nview_iterator
  35. : iterator_base<nview_iterator<Sequence, Pos> >
  36. {
  37. typedef nview_iterator_tag fusion_tag;
  38. typedef random_access_traversal_tag category;
  39. typedef Sequence sequence_type;
  40. typedef Pos first_type;
  41. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  42. explicit nview_iterator(Sequence& in_seq)
  43. : seq(in_seq) {}
  44. Sequence& seq;
  45. };
  46. }}
  47. #ifdef _MSC_VER
  48. # pragma warning(pop)
  49. #endif
  50. #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
  51. namespace std
  52. {
  53. template <typename Sequence, typename Pos>
  54. struct iterator_traits< ::boost::fusion::nview_iterator<Sequence, Pos> >
  55. { };
  56. }
  57. #endif
  58. #endif