| 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 | #ifdef _MSC_VER |
| 23 | # pragma warning(push) |
| 24 | # pragma warning(disable: 4512) // assignment operator could not be generated. |
| 25 | #endif |
| 26 | |
| 27 | namespace boost { namespace fusion |
| 28 | { |
| 29 | struct vector_iterator_tag; |
| 30 | struct random_access_traversal_tag; |
| 31 | |
| 32 | template <typename Vector, int N> |
| 33 | struct vector_iterator_identity; |
| 34 | |
| 35 | template <typename Vector, int N> |
| 36 | struct vector_iterator : iterator_base<vector_iterator<Vector, N> > |
| 37 | { |
| 38 | typedef mpl::int_<N> index; |
| 39 | typedef Vector vector; |
| 40 | typedef vector_iterator_tag fusion_tag; |
| 41 | typedef random_access_traversal_tag category; |
| 42 | typedef vector_iterator_identity< |
| 43 | typename add_const<Vector>::type, N> identity; |
| 44 | |
| 45 | BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED |
| 46 | vector_iterator(Vector& in_vec) |
| 47 | : vec(in_vec) {} |
| 48 | |
| 49 | Vector& vec; |
| 50 | }; |
| 51 | }} |
| 52 | |
| 53 | #ifdef _MSC_VER |
| 54 | # pragma warning(pop) |
| 55 | #endif |
| 56 | |
| 57 | #ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408 |
| 58 | namespace std |
| 59 | { |
| 60 | template <typename Vector, int N> |
| 61 | struct iterator_traits< ::boost::fusion::vector_iterator<Vector, N> > |
| 62 | { }; |
| 63 | } |
| 64 | #endif |
| 65 | |
| 66 | #endif |
| 67 | |
| 68 |