/*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ #if !defined(FUSION_JOINT_VIEW_07162005_0140) #define FUSION_JOINT_VIEW_07162005_0140 #include #include #include #include #include #include #include #include #include #include #include #include namespace boost { namespace fusion { struct joint_view_tag; struct forward_traversal_tag; struct fusion_sequence_tag; template struct joint_view : sequence_base > { typedef joint_view_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef forward_traversal_tag category; typedef mpl::true_ is_view; typedef typename result_of::begin::type first_type; typedef typename result_of::end::type last_type; typedef typename result_of::begin::type concat_type; typedef typename result_of::end::type concat_last_type; typedef typename mpl::plus, result_of::size >::type size; joint_view(Sequence1& seq1, Sequence2& seq2) : seq1(seq1) , seq2(seq2) {} first_type first() const { return fusion::begin(seq1); } concat_type concat() const { return fusion::begin(seq2); } concat_last_type concat_last() const { return fusion::end(seq2); } private: typename mpl::if_, Sequence1, Sequence1&>::type seq1; typename mpl::if_, Sequence2, Sequence2&>::type seq2; }; }} #endif