[857] | 1 | /*=============================================================================
|
---|
| 2 | Copyright (c) 2003 Joel de Guzman
|
---|
| 3 | Copyright (c) 2004 Peder Holt
|
---|
| 4 |
|
---|
| 5 | Use, modification and distribution is subject to the Boost Software
|
---|
| 6 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
---|
| 7 | http://www.boost.org/LICENSE_1_0.txt)
|
---|
| 8 | ==============================================================================*/
|
---|
| 9 | #if !defined(FUSION_ITERATOR_JOINT_VIEW_ITERATOR_HPP)
|
---|
| 10 | #define FUSION_ITERATOR_JOINT_VIEW_ITERATOR_HPP
|
---|
| 11 |
|
---|
| 12 | #include <boost/spirit/fusion/iterator/as_fusion_iterator.hpp>
|
---|
| 13 | #include <boost/spirit/fusion/iterator/detail/iterator_base.hpp>
|
---|
| 14 | #include <boost/spirit/fusion/iterator/detail/joint_view_iterator/deref_traits.hpp>
|
---|
| 15 | #include <boost/spirit/fusion/iterator/detail/joint_view_iterator/next_traits.hpp>
|
---|
| 16 | #include <boost/spirit/fusion/iterator/detail/joint_view_iterator/value_traits.hpp>
|
---|
| 17 | #include <boost/spirit/fusion/iterator/equal_to.hpp>
|
---|
| 18 |
|
---|
| 19 | namespace boost { namespace fusion
|
---|
| 20 | {
|
---|
| 21 | struct joint_view_iterator_tag;
|
---|
| 22 |
|
---|
| 23 | template <typename First, typename Last, typename Concat>
|
---|
| 24 | struct joint_view_iterator
|
---|
| 25 | : iterator_base<joint_view_iterator<First, Last, Concat> >
|
---|
| 26 | {
|
---|
| 27 | typedef as_fusion_iterator<First> first_converter;
|
---|
| 28 | typedef as_fusion_iterator<Last> last_converter;
|
---|
| 29 | typedef as_fusion_iterator<Concat> concat_converter;
|
---|
| 30 |
|
---|
| 31 | typedef typename first_converter::type first_type;
|
---|
| 32 | typedef typename last_converter::type last_type;
|
---|
| 33 | typedef typename concat_converter::type concat_type;
|
---|
| 34 |
|
---|
| 35 | typedef joint_view_iterator_tag tag;
|
---|
| 36 | #if! BOOST_WORKAROUND(BOOST_MSVC,<=1300)
|
---|
| 37 | BOOST_STATIC_ASSERT((!meta::equal_to<first_type, last_type>::value));
|
---|
| 38 | #endif
|
---|
| 39 | joint_view_iterator(First const& first, Concat const& concat);
|
---|
| 40 |
|
---|
| 41 | first_type first;
|
---|
| 42 | concat_type concat;
|
---|
| 43 | };
|
---|
| 44 | template <typename First, typename Last, typename Concat>
|
---|
| 45 | joint_view_iterator<First,Last,Concat>::joint_view_iterator(First const& first, Concat const& concat)
|
---|
| 46 | : first(first_converter::convert(first))
|
---|
| 47 | , concat(concat_converter::convert(concat))
|
---|
| 48 | {}
|
---|
| 49 |
|
---|
| 50 |
|
---|
| 51 | }}
|
---|
| 52 |
|
---|
| 53 | #endif
|
---|
| 54 |
|
---|
| 55 |
|
---|