repetitive_view.hpp 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*=============================================================================
  2. Copyright (c) 2007 Tobias Schwinger
  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. #ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
  7. #define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
  8. #include <boost/fusion/support/config.hpp>
  9. #include <boost/type_traits/remove_reference.hpp>
  10. #include <boost/mpl/if.hpp>
  11. #include <boost/fusion/support/is_view.hpp>
  12. #include <boost/fusion/support/category_of.hpp>
  13. #include <boost/fusion/view/repetitive_view/detail/begin_impl.hpp>
  14. #include <boost/fusion/view/repetitive_view/detail/end_impl.hpp>
  15. #ifdef _MSC_VER
  16. # pragma warning(push)
  17. # pragma warning(disable: 4512) // assignment operator could not be generated.
  18. #endif
  19. namespace boost { namespace fusion
  20. {
  21. struct repetitive_view_tag;
  22. struct fusion_sequence_tag;
  23. template<typename Sequence> struct repetitive_view
  24. : sequence_base< repetitive_view<Sequence> >
  25. {
  26. typedef repetitive_view_tag fusion_tag;
  27. typedef fusion_sequence_tag tag; // this gets picked up by MPL
  28. typedef mpl::true_ is_view;
  29. typedef single_pass_traversal_tag category;
  30. typedef typename boost::remove_reference<Sequence>::type sequence_type;
  31. typedef typename
  32. mpl::if_<traits::is_view<Sequence>, Sequence, sequence_type&>::type
  33. stored_seq_type;
  34. BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
  35. repetitive_view(Sequence& in_seq)
  36. : seq(in_seq) {}
  37. stored_seq_type seq;
  38. };
  39. }}
  40. #ifdef _MSC_VER
  41. # pragma warning(pop)
  42. #endif
  43. #endif