diff options
author | Vlad Voicu <vladv@rosedu.org> | 2012-03-02 10:01:11 (GMT) |
---|---|---|
committer | vlad <vlad@tyrion.(none)> | 2012-10-13 13:55:44 (GMT) |
commit | b21e43357c66df6824536793bf41bbd1cbdf1a72 (patch) | |
tree | a23ee2adda43c27aa1b720f524e368991264182c /3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp | |
parent | 58efe2c43e54a3d868784a6968e52674309e2310 (diff) | |
download | swift-contrib-b21e43357c66df6824536793bf41bbd1cbdf1a72.zip swift-contrib-b21e43357c66df6824536793bf41bbd1cbdf1a72.tar.bz2 |
Added spirit to bundled boost
Diffstat (limited to '3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp')
-rw-r--r-- | 3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp b/3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp new file mode 100644 index 0000000..f3e8ffe --- /dev/null +++ b/3rdParty/Boost/src/boost/fusion/view/reverse_view/reverse_view.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + 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 <boost/fusion/support/detail/access.hpp> +#include <boost/fusion/support/is_view.hpp> +#include <boost/fusion/support/category_of.hpp> +#include <boost/fusion/view/reverse_view/reverse_view_iterator.hpp> +#include <boost/fusion/view/reverse_view/detail/begin_impl.hpp> +#include <boost/fusion/view/reverse_view/detail/end_impl.hpp> +#include <boost/fusion/view/reverse_view/detail/at_impl.hpp> +#include <boost/fusion/view/reverse_view/detail/value_at_impl.hpp> +#include <boost/fusion/support/sequence_base.hpp> +#include <boost/fusion/sequence/intrinsic/begin.hpp> +#include <boost/fusion/sequence/intrinsic/end.hpp> +#include <boost/fusion/sequence/intrinsic/size.hpp> +#include <boost/type_traits/is_base_of.hpp> +#include <boost/static_assert.hpp> +#include <boost/mpl/bool.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/inherit.hpp> +#include <boost/mpl/identity.hpp> + +namespace boost { namespace fusion +{ + struct reverse_view_tag; + struct fusion_sequence_tag; + + template <typename Sequence> + struct reverse_view : sequence_base<reverse_view<Sequence> > + { + 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<Sequence>::type category; + typedef typename result_of::begin<Sequence>::type first_type; + typedef typename result_of::end<Sequence>::type last_type; + typedef typename result_of::size<Sequence>::type size; + + BOOST_STATIC_ASSERT(( + is_base_of< + bidirectional_traversal_tag + , typename traits::category_of<first_type>::type>::value)); + + reverse_view(Sequence& in_seq) + : seq(in_seq) + {} + + first_type first() const { return fusion::begin(seq); } + last_type last() const { return fusion::end(seq); } + typename mpl::if_<traits::is_view<Sequence>, Sequence, Sequence&>::type seq; + + private: + // silence MSVC warning C4512: assignment operator could not be generated + reverse_view& operator= (reverse_view const&); + }; +}} + +#endif + + |