/*============================================================================= 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_REVERSE_VIEW_07202005_0836) #define FUSION_REVERSE_VIEW_07202005_0836 #include #include #include #include #include #include #include #include #include #include #include #include #include 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 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)); reverse_view(Sequence& seq) : seq(seq) {} first_type first() const { return fusion::begin(seq); } last_type last() const { return fusion::end(seq); } typename mpl::if_, Sequence, Sequence&>::type seq; }; }} #endif