/*============================================================================= Copyright (c) 2001-2011 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 #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 typename mpl::eval_if< mpl::and_< traits::is_associative , traits::is_associative > , mpl::inherit2 , mpl::identity >::type 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::int_< result_of::size::value + result_of::size::value> size; BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED joint_view(Sequence1& in_seq1, Sequence2& in_seq2) : seq1(in_seq1) , seq2(in_seq2) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq1); } BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_type concat() const { return fusion::begin(seq2); } BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED concat_last_type concat_last() const { return fusion::end(seq2); } // silence MSVC warning C4512: assignment operator could not be generated BOOST_DELETED_FUNCTION(joint_view& operator= (joint_view const&)) private: typename mpl::if_, Sequence1, Sequence1&>::type seq1; typename mpl::if_, Sequence2, Sequence2&>::type seq2; }; }} #endif