joint_view_iterator.hpp 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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_JOINT_VIEW_ITERATOR_07162005_0140)
  7. #define FUSION_JOINT_VIEW_ITERATOR_07162005_0140
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/fusion/support/iterator_base.hpp>
  10. #include <boost/fusion/iterator/equal_to.hpp>
  11. #include <boost/fusion/iterator/mpl/convert_iterator.hpp>
  12. #include <boost/fusion/adapted/mpl/mpl_iterator.hpp>
  13. #include <boost/fusion/view/joint_view/detail/deref_impl.hpp>
  14. #include <boost/fusion/view/joint_view/detail/next_impl.hpp>
  15. #include <boost/fusion/view/joint_view/detail/value_of_impl.hpp>
  16. #include <boost/fusion/view/joint_view/detail/deref_data_impl.hpp>
  17. #include <boost/fusion/view/joint_view/detail/value_of_data_impl.hpp>
  18. #include <boost/fusion/view/joint_view/detail/key_of_impl.hpp>
  19. #include <boost/static_assert.hpp>
  20. #ifdef _MSC_VER
  21. # pragma warning(push)
  22. # pragma warning(disable: 4512) // assignment operator could not be generated.
  23. #endif
  24. namespace boost { namespace fusion
  25. {
  26. struct joint_view_iterator_tag;
  27. struct forward_traversal_tag;
  28. template <typename Category, typename First, typename Last, typename Concat>
  29. struct joint_view_iterator
  30. : iterator_base<joint_view_iterator<Category, First, Last, Concat> >
  31. {
  32. typedef convert_iterator<First> first_converter;
  33. typedef convert_iterator<Last> last_converter;
  34. typedef convert_iterator<Concat> concat_converter;
  35. typedef typename first_converter::type first_type;
  36. typedef typename last_converter::type last_type;
  37. typedef typename concat_converter::type concat_type;
  38. typedef joint_view_iterator_tag fusion_tag;
  39. typedef Category category;
  40. BOOST_STATIC_ASSERT((!result_of::equal_to<first_type, last_type>::value));
  41. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  42. joint_view_iterator(First const& in_first, Concat const& in_concat)
  43. : first(first_converter::call(in_first))
  44. , concat(concat_converter::call(in_concat))
  45. {}
  46. first_type first;
  47. concat_type concat;
  48. };
  49. }}
  50. #ifdef _MSC_VER
  51. # pragma warning(pop)
  52. #endif
  53. #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408
  54. namespace std
  55. {
  56. template <typename Category, typename First, typename Last, typename Concat>
  57. struct iterator_traits< ::boost::fusion::joint_view_iterator<Category, First, Last, Concat> >
  58. { };
  59. }
  60. #endif
  61. #endif