File indexing completed on 2025-01-18 09:34:59
0001
0002
0003
0004
0005
0006
0007 #if !defined(FUSION_JOINT_VIEW_07162005_0140)
0008 #define FUSION_JOINT_VIEW_07162005_0140
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/view/joint_view/joint_view_fwd.hpp>
0012 #include <boost/fusion/support/detail/access.hpp>
0013 #include <boost/fusion/support/is_view.hpp>
0014 #include <boost/fusion/sequence/intrinsic/begin.hpp>
0015 #include <boost/fusion/sequence/intrinsic/end.hpp>
0016 #include <boost/fusion/sequence/intrinsic/size.hpp>
0017 #include <boost/fusion/view/joint_view/joint_view_iterator.hpp>
0018 #include <boost/fusion/view/joint_view/detail/begin_impl.hpp>
0019 #include <boost/fusion/view/joint_view/detail/end_impl.hpp>
0020 #include <boost/fusion/support/sequence_base.hpp>
0021 #include <boost/mpl/if.hpp>
0022 #include <boost/mpl/plus.hpp>
0023 #include <boost/mpl/bool.hpp>
0024 #include <boost/mpl/eval_if.hpp>
0025 #include <boost/mpl/inherit.hpp>
0026 #include <boost/mpl/identity.hpp>
0027
0028 #ifdef _MSC_VER
0029 # pragma warning(push)
0030 # pragma warning(disable: 4512)
0031 #endif
0032
0033 namespace boost { namespace fusion
0034 {
0035 struct joint_view_tag;
0036 struct forward_traversal_tag;
0037 struct fusion_sequence_tag;
0038
0039 template <typename Sequence1, typename Sequence2>
0040 struct joint_view : sequence_base<joint_view<Sequence1, Sequence2> >
0041 {
0042 typedef joint_view_tag fusion_tag;
0043 typedef fusion_sequence_tag tag;
0044 typedef typename
0045 mpl::eval_if<
0046 mpl::and_<
0047 traits::is_associative<Sequence1>
0048 , traits::is_associative<Sequence2>
0049 >
0050 , mpl::inherit2<forward_traversal_tag,associative_tag>
0051 , mpl::identity<forward_traversal_tag>
0052 >::type
0053 category;
0054 typedef mpl::true_ is_view;
0055
0056 typedef typename result_of::begin<Sequence1>::type first_type;
0057 typedef typename result_of::end<Sequence1>::type last_type;
0058 typedef typename result_of::begin<Sequence2>::type concat_type;
0059 typedef typename result_of::end<Sequence2>::type concat_last_type;
0060 typedef typename mpl::int_<
0061 result_of::size<Sequence1>::value + result_of::size<Sequence2>::value>
0062 size;
0063
0064 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0065 joint_view(Sequence1& in_seq1, Sequence2& in_seq2)
0066 : seq1(in_seq1)
0067 , seq2(in_seq2)
0068 {}
0069
0070 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0071 first_type first() const { return fusion::begin(seq1); }
0072 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0073 concat_type concat() const { return fusion::begin(seq2); }
0074 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0075 concat_last_type concat_last() const { return fusion::end(seq2); }
0076
0077 private:
0078 typename mpl::if_<traits::is_view<Sequence1>, Sequence1, Sequence1&>::type seq1;
0079 typename mpl::if_<traits::is_view<Sequence2>, Sequence2, Sequence2&>::type seq2;
0080 };
0081 }}
0082
0083 #ifdef _MSC_VER
0084 # pragma warning(pop)
0085 #endif
0086
0087 #endif
0088
0089