1 /*=============================================================================
2 Copyright (c) 2007 Tobias Schwinger
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 ==============================================================================*/
8 #ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
9 #define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/type_traits/remove_reference.hpp>
13 #include <boost/mpl/if.hpp>
15 #include <boost/fusion/support/is_view.hpp>
16 #include <boost/fusion/support/category_of.hpp>
18 #include <boost/fusion/view/repetitive_view/detail/begin_impl.hpp>
19 #include <boost/fusion/view/repetitive_view/detail/end_impl.hpp>
22 namespace boost { namespace fusion
24 struct repetitive_view_tag;
25 struct fusion_sequence_tag;
27 template<typename Sequence> struct repetitive_view
28 : sequence_base< repetitive_view<Sequence> >
30 typedef repetitive_view_tag fusion_tag;
31 typedef fusion_sequence_tag tag; // this gets picked up by MPL
32 typedef mpl::true_ is_view;
34 typedef single_pass_traversal_tag category;
36 typedef typename boost::remove_reference<Sequence>::type sequence_type;
38 mpl::if_<traits::is_view<Sequence>, Sequence, sequence_type&>::type
41 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
42 repetitive_view(Sequence& in_seq)
47 // silence MSVC warning C4512: assignment operator could not be generated
48 BOOST_DELETED_FUNCTION(repetitive_view& operator= (repetitive_view const&))