]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | /*============================================================================= |
2 | Copyright (c) 2001-2011 Joel de Guzman | |
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 | #if !defined(FUSION_VECTOR_ITERATOR_05042005_0635) | |
8 | #define FUSION_VECTOR_ITERATOR_05042005_0635 | |
9 | ||
10 | #include <boost/fusion/support/config.hpp> | |
11 | #include <boost/fusion/support/iterator_base.hpp> | |
12 | #include <boost/fusion/container/vector/detail/deref_impl.hpp> | |
13 | #include <boost/fusion/container/vector/detail/value_of_impl.hpp> | |
14 | #include <boost/fusion/container/vector/detail/next_impl.hpp> | |
15 | #include <boost/fusion/container/vector/detail/prior_impl.hpp> | |
16 | #include <boost/fusion/container/vector/detail/equal_to_impl.hpp> | |
17 | #include <boost/fusion/container/vector/detail/distance_impl.hpp> | |
18 | #include <boost/fusion/container/vector/detail/advance_impl.hpp> | |
19 | #include <boost/type_traits/add_const.hpp> | |
20 | #include <boost/mpl/int.hpp> | |
21 | ||
22 | namespace boost { namespace fusion | |
23 | { | |
24 | struct vector_iterator_tag; | |
25 | struct random_access_traversal_tag; | |
26 | ||
27 | template <typename Vector, int N> | |
28 | struct vector_iterator_identity; | |
29 | ||
30 | template <typename Vector, int N> | |
31 | struct vector_iterator : iterator_base<vector_iterator<Vector, N> > | |
32 | { | |
33 | typedef mpl::int_<N> index; | |
34 | typedef Vector vector; | |
35 | typedef vector_iterator_tag fusion_tag; | |
36 | typedef random_access_traversal_tag category; | |
37 | typedef vector_iterator_identity< | |
38 | typename add_const<Vector>::type, N> identity; | |
39 | ||
40 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED | |
41 | vector_iterator(Vector& in_vec) | |
42 | : vec(in_vec) {} | |
43 | ||
44 | Vector& vec; | |
45 | ||
46 | private: | |
47 | // silence MSVC warning C4512: assignment operator could not be generated | |
48 | vector_iterator& operator= (vector_iterator const&); | |
49 | }; | |
50 | }} | |
51 | ||
52 | #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408 | |
53 | namespace std | |
54 | { | |
55 | template <typename Vector, int N> | |
56 | struct iterator_traits< ::boost::fusion::vector_iterator<Vector, N> > | |
57 | { }; | |
58 | } | |
59 | #endif | |
60 | ||
61 | #endif | |
62 |