Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:34:59

0001 /*=============================================================================
0002     Copyright (c) 2001-2011 Joel de Guzman
0003 
0004     Distributed under the Boost Software License, Version 1.0. (See accompanying 
0005     file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0006 ==============================================================================*/
0007 #if !defined(FUSION_REVERSE_VIEW_07202005_0836)
0008 #define FUSION_REVERSE_VIEW_07202005_0836
0009 
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/support/detail/access.hpp>
0012 #include <boost/fusion/support/is_view.hpp>
0013 #include <boost/fusion/support/category_of.hpp>
0014 #include <boost/fusion/view/reverse_view/reverse_view_iterator.hpp>
0015 #include <boost/fusion/view/reverse_view/detail/begin_impl.hpp>
0016 #include <boost/fusion/view/reverse_view/detail/end_impl.hpp>
0017 #include <boost/fusion/view/reverse_view/detail/at_impl.hpp>
0018 #include <boost/fusion/view/reverse_view/detail/value_at_impl.hpp>
0019 #include <boost/fusion/support/sequence_base.hpp>
0020 #include <boost/fusion/sequence/intrinsic/begin.hpp>
0021 #include <boost/fusion/sequence/intrinsic/end.hpp>
0022 #include <boost/fusion/sequence/intrinsic/size.hpp>
0023 #include <boost/type_traits/is_base_of.hpp>
0024 #include <boost/static_assert.hpp>
0025 #include <boost/mpl/bool.hpp>
0026 #include <boost/mpl/eval_if.hpp>
0027 #include <boost/mpl/inherit.hpp>
0028 #include <boost/mpl/identity.hpp>
0029 
0030 #ifdef _MSC_VER
0031 #  pragma warning(push)
0032 #  pragma warning(disable: 4512) // assignment operator could not be generated.
0033 #endif
0034 
0035 namespace boost { namespace fusion
0036 {
0037     struct reverse_view_tag;
0038     struct fusion_sequence_tag;
0039 
0040     template <typename Sequence>
0041     struct reverse_view : sequence_base<reverse_view<Sequence> >
0042     {
0043         typedef reverse_view_tag fusion_tag;
0044         typedef fusion_sequence_tag tag; // this gets picked up by MPL
0045         typedef mpl::true_ is_view;
0046 
0047         typedef Sequence seq_type;
0048         typedef typename traits::category_of<Sequence>::type category;
0049         typedef typename result_of::begin<Sequence>::type first_type;
0050         typedef typename result_of::end<Sequence>::type last_type;
0051         typedef typename result_of::size<Sequence>::type size;
0052 
0053         BOOST_STATIC_ASSERT((
0054             is_base_of<
0055                 bidirectional_traversal_tag
0056               , typename traits::category_of<first_type>::type>::value));
0057 
0058         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0059         reverse_view(Sequence& in_seq)
0060             : seq(in_seq)
0061         {}
0062 
0063         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0064         first_type first() const { return fusion::begin(seq); }
0065         BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0066         last_type last() const { return fusion::end(seq); }
0067         typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq;
0068     };
0069 }}
0070 
0071 #ifdef _MSC_VER
0072 #  pragma warning(pop)
0073 #endif
0074 
0075 #endif
0076 
0077