| 1 | /*=============================================================================
|
|---|
| 2 | Copyright (c) 2001-2006 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 | #if defined (BOOST_MSVC)
|
|---|
| 11 | # pragma warning(push)
|
|---|
| 12 | # pragma warning (disable: 4512) // assignment operator could not be generated.
|
|---|
| 13 | #endif
|
|---|
| 14 |
|
|---|
| 15 | #include <boost/fusion/support/iterator_base.hpp>
|
|---|
| 16 | #include <boost/fusion/container/vector/detail/deref_impl.hpp>
|
|---|
| 17 | #include <boost/fusion/container/vector/detail/value_of_impl.hpp>
|
|---|
| 18 | #include <boost/fusion/container/vector/detail/next_impl.hpp>
|
|---|
| 19 | #include <boost/fusion/container/vector/detail/prior_impl.hpp>
|
|---|
| 20 | #include <boost/fusion/container/vector/detail/equal_to_impl.hpp>
|
|---|
| 21 | #include <boost/fusion/container/vector/detail/distance_impl.hpp>
|
|---|
| 22 | #include <boost/fusion/container/vector/detail/advance_impl.hpp>
|
|---|
| 23 | #include <boost/type_traits/add_const.hpp>
|
|---|
| 24 | #include <boost/mpl/int.hpp>
|
|---|
| 25 |
|
|---|
| 26 | namespace boost { namespace fusion
|
|---|
| 27 | {
|
|---|
| 28 | struct vector_iterator_tag;
|
|---|
| 29 | struct random_access_traversal_tag;
|
|---|
| 30 |
|
|---|
| 31 | template <typename Vector, int N>
|
|---|
| 32 | struct vector_iterator_identity;
|
|---|
| 33 |
|
|---|
| 34 | template <typename Vector, int N>
|
|---|
| 35 | struct vector_iterator : iterator_base<vector_iterator<Vector, N> >
|
|---|
| 36 | {
|
|---|
| 37 | typedef mpl::int_<N> index;
|
|---|
| 38 | typedef Vector vector;
|
|---|
| 39 | typedef vector_iterator_tag fusion_tag;
|
|---|
| 40 | typedef random_access_traversal_tag category;
|
|---|
| 41 | typedef vector_iterator_identity<
|
|---|
| 42 | typename add_const<Vector>::type, N> identity;
|
|---|
| 43 |
|
|---|
| 44 | vector_iterator(Vector& vec)
|
|---|
| 45 | : vec(vec) {}
|
|---|
| 46 | Vector& vec;
|
|---|
| 47 | };
|
|---|
| 48 | }}
|
|---|
| 49 |
|
|---|
| 50 | #if defined (BOOST_MSVC)
|
|---|
| 51 | # pragma warning(pop)
|
|---|
| 52 | #endif
|
|---|
| 53 |
|
|---|
| 54 | #endif
|
|---|
| 55 |
|
|---|