[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_SEQUENCE_JOINT_VIEW_HPP)
|
---|
| 10 | #define FUSION_SEQUENCE_JOINT_VIEW_HPP
|
---|
| 11 |
|
---|
| 12 | #include <boost/spirit/fusion/detail/access.hpp>
|
---|
| 13 | #include <boost/spirit/fusion/sequence/begin.hpp>
|
---|
| 14 | #include <boost/spirit/fusion/sequence/end.hpp>
|
---|
| 15 | #include <boost/spirit/fusion/iterator/joint_view_iterator.hpp>
|
---|
| 16 | #include <boost/spirit/fusion/sequence/detail/joint_view_begin_end_traits.hpp>
|
---|
| 17 | #include <boost/spirit/fusion/sequence/detail/sequence_base.hpp>
|
---|
| 18 | #include <boost/spirit/fusion/sequence/as_fusion_sequence.hpp>
|
---|
| 19 |
|
---|
| 20 | namespace boost { namespace fusion
|
---|
| 21 | {
|
---|
| 22 | struct joint_view_tag;
|
---|
| 23 |
|
---|
| 24 | template <typename View1, typename View2>
|
---|
| 25 | struct joint_view : sequence_base<joint_view<View1, View2> >
|
---|
| 26 | {
|
---|
| 27 | typedef as_fusion_sequence<View1> view1_converter;
|
---|
| 28 | typedef typename view1_converter::type view1;
|
---|
| 29 | typedef as_fusion_sequence<View2> view2_converter;
|
---|
| 30 | typedef typename view2_converter::type view2;
|
---|
| 31 |
|
---|
| 32 | typedef joint_view_tag tag;
|
---|
| 33 | typedef typename meta::begin<view1>::type first_type;
|
---|
| 34 | typedef typename meta::end<view1>::type last_type;
|
---|
| 35 | typedef typename meta::begin<view2>::type concat_type;
|
---|
| 36 | typedef typename meta::end<view2>::type concat_last_type;
|
---|
| 37 |
|
---|
| 38 | joint_view(View1& view1, View2& view2);
|
---|
| 39 |
|
---|
| 40 | first_type first;
|
---|
| 41 | concat_type concat;
|
---|
| 42 | concat_last_type concat_last;
|
---|
| 43 | };
|
---|
| 44 |
|
---|
| 45 | template <typename View1, typename View2>
|
---|
| 46 | joint_view<View1,View2>::joint_view(View1& view1, View2& view2)
|
---|
| 47 | : first(fusion::begin(view1))
|
---|
| 48 | , concat(fusion::begin(view2))
|
---|
| 49 | , concat_last(fusion::end(view2))
|
---|
| 50 | {}
|
---|
| 51 |
|
---|
| 52 | }}
|
---|
| 53 |
|
---|
| 54 | #endif
|
---|
| 55 |
|
---|
| 56 |
|
---|