/*============================================================================= 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_REVERSE_VIEW_07202005_0836) #define FUSION_REVERSE_VIEW_07202005_0836 #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifdef _MSC_VER # pragma warning(push) # pragma warning(disable: 4512) // assignment operator could not be generated. #endif namespace boost { namespace fusion { struct reverse_view_tag; struct fusion_sequence_tag; template struct reverse_view : sequence_base > { typedef reverse_view_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; typedef Sequence seq_type; typedef typename traits::category_of::type category; typedef typename result_of::begin::type first_type; typedef typename result_of::end::type last_type; typedef typename result_of::size::type size; BOOST_STATIC_ASSERT(( is_base_of< bidirectional_traversal_tag , typename traits::category_of::type>::value)); BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED reverse_view(Sequence& in_seq) : seq(in_seq) {} BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED first_type first() const { return fusion::begin(seq); } BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; }; }} #ifdef _MSC_VER # pragma warning(pop) #endif #endif