X-Git-Url: https://git.donarmstrong.com/?p=rsem.git;a=blobdiff_plain;f=boost%2Ffusion%2Fcontainer%2Flist%2Fdetail%2Freverse_cons.hpp;fp=boost%2Ffusion%2Fcontainer%2Flist%2Fdetail%2Freverse_cons.hpp;h=5083e0c0d115b212e509b03cbd09216e89774ac3;hp=0000000000000000000000000000000000000000;hb=2d71eb92104693ca9baa5a2e1c23eeca776d8fd3;hpb=da57529b92adbb7ae74a89861cb39fb35ac7c62d diff --git a/boost/fusion/container/list/detail/reverse_cons.hpp b/boost/fusion/container/list/detail/reverse_cons.hpp new file mode 100644 index 0000000..5083e0c --- /dev/null +++ b/boost/fusion/container/list/detail/reverse_cons.hpp @@ -0,0 +1,43 @@ +/*============================================================================= + Copyright (c) 2011 Eric Niebler + + 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(BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED) +#define BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED + +#include + +namespace boost { namespace fusion { namespace detail +{ + //////////////////////////////////////////////////////////////////////////// + template + struct reverse_cons; + + template + struct reverse_cons, State> + { + typedef reverse_cons > impl; + typedef typename impl::type type; + + static type call(cons const &cons, State const &state = State()) + { + typedef fusion::cons cdr_type; + return impl::call(cons.cdr, cdr_type(cons.car, state)); + } + }; + + template + struct reverse_cons + { + typedef State type; + + static State const &call(nil_ const &, State const &state = State()) + { + return state; + } + }; +}}} + +#endif