]> git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/fusion/include/boost/fusion/view/repetitive_view/repetitive_view.hpp
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / boost / libs / fusion / include / boost / fusion / view / repetitive_view / repetitive_view.hpp
1 /*=============================================================================
2 Copyright (c) 2007 Tobias Schwinger
3
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
8 #ifndef BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
9 #define BOOST_FUSION_REPETITIVE_VIEW_REPETITIVE_VIEW_HPP_INCLUDED
10
11 #include <boost/fusion/support/config.hpp>
12 #include <boost/type_traits/remove_reference.hpp>
13 #include <boost/mpl/if.hpp>
14
15 #include <boost/fusion/support/is_view.hpp>
16 #include <boost/fusion/support/category_of.hpp>
17
18 #include <boost/fusion/view/repetitive_view/detail/begin_impl.hpp>
19 #include <boost/fusion/view/repetitive_view/detail/end_impl.hpp>
20
21
22 namespace boost { namespace fusion
23 {
24 struct repetitive_view_tag;
25 struct fusion_sequence_tag;
26
27 template<typename Sequence> struct repetitive_view
28 : sequence_base< repetitive_view<Sequence> >
29 {
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;
33
34 typedef single_pass_traversal_tag category;
35
36 typedef typename boost::remove_reference<Sequence>::type sequence_type;
37 typedef typename
38 mpl::if_<traits::is_view<Sequence>, Sequence, sequence_type&>::type
39 stored_seq_type;
40
41 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
42 repetitive_view(Sequence& in_seq)
43 : seq(in_seq) {}
44
45 stored_seq_type seq;
46
47 private:
48 // silence MSVC warning C4512: assignment operator could not be generated
49 repetitive_view& operator= (repetitive_view const&);
50 };
51
52 }}
53
54 #endif