File indexing completed on 2025-01-18 09:33:20
0001
0002
0003
0004
0005
0006
0007 #if !defined(BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED)
0008 #define BOOST_FUSION_REVERSE_CONS_HPP_INCLUDED
0009
0010 #include <boost/fusion/support/config.hpp>
0011 #include <boost/fusion/container/list/cons_fwd.hpp>
0012
0013 namespace boost { namespace fusion { namespace detail
0014 {
0015
0016 template<typename Cons, typename State = nil_>
0017 struct reverse_cons;
0018
0019 template<typename Car, typename Cdr, typename State>
0020 struct reverse_cons<cons<Car, Cdr>, State>
0021 {
0022 typedef reverse_cons<Cdr, cons<Car, State> > impl;
0023 typedef typename impl::type type;
0024
0025 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0026 static type call(cons<Car, Cdr> const &cons, State const &state = State())
0027 {
0028 typedef fusion::cons<Car, State> cdr_type;
0029 return impl::call(cons.cdr, cdr_type(cons.car, state));
0030 }
0031 };
0032
0033 template<typename State>
0034 struct reverse_cons<nil_, State>
0035 {
0036 typedef State type;
0037
0038 BOOST_CONSTEXPR BOOST_FUSION_GPU_ENABLED
0039 static State const &call(nil_ const &, State const &state = State())
0040 {
0041 return state;
0042 }
0043 };
0044 }}}
0045
0046 #endif