2 #ifndef BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED
3 #define BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED
18 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
28 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
29 && !defined(BOOST_MPL_PREPROCESSING_MODE)
31 # define BOOST_MPL_PREPROCESSED_HEADER iter_fold_if_impl.hpp
43 namespace boost {
namespace mpl {
namespace aux {
45 template<
typename Iterator,
typename State >
46 struct iter_fold_if_null_step
53 struct iter_fold_if_step_impl
64 typedef typename IteratorOp::type
iterator;
69 struct iter_fold_if_step_impl<false>
93 struct iter_fold_if_forward_step
96 typedef typename iter_fold_if_step_impl<
98 >::template result_< Iterator,State,ForwardOp,mpl::next<Iterator> >
impl_;
100 typedef typename impl_::state
state;
101 typedef typename impl_::iterator
iterator;
107 ,
typename BackwardOp
110 struct iter_fold_if_backward_step
113 typedef typename iter_fold_if_step_impl<
115 >::template result_< Iterator,State,BackwardOp,identity<Iterator> >
impl_;
117 typedef typename impl_::state
state;
118 typedef typename impl_::iterator
iterator;
124 # define AUX_ITER_FOLD_FORWARD_STEP(unused, i, unused2) \
125 typedef iter_fold_if_forward_step< \
126 typename BOOST_PP_CAT(forward_step,i)::iterator \
127 , typename BOOST_PP_CAT(forward_step,i)::state \
130 > BOOST_PP_CAT(forward_step, BOOST_PP_INC(i)); \
133 # define AUX_ITER_FOLD_BACKWARD_STEP_FUNC(i) \
134 typedef iter_fold_if_backward_step< \
135 typename BOOST_PP_CAT(forward_step,BOOST_PP_DEC(i))::iterator \
136 , typename BOOST_PP_CAT(backward_step,i)::state \
138 , BackwardPredicate \
139 > BOOST_PP_CAT(backward_step,BOOST_PP_DEC(i)); \
142 # define AUX_ITER_FOLD_BACKWARD_STEP(unused, i, unused2) \
143 AUX_ITER_FOLD_BACKWARD_STEP_FUNC( \
144 BOOST_PP_SUB_D(1,BOOST_MPL_LIMIT_UNROLLING,i) \
148 # define AUX_LAST_FORWARD_STEP \
149 BOOST_PP_CAT(forward_step, BOOST_MPL_LIMIT_UNROLLING) \
152 # define AUX_LAST_BACKWARD_STEP \
153 BOOST_PP_CAT(backward_step, BOOST_MPL_LIMIT_UNROLLING) \
160 ,
typename ForwardPredicate
161 ,
typename BackwardOp
162 ,
typename BackwardPredicate
164 struct iter_fold_if_impl
167 typedef iter_fold_if_null_step<Iterator,State>
forward_step0;
170 , AUX_ITER_FOLD_FORWARD_STEP
174 typedef typename if_<
175 typename AUX_LAST_FORWARD_STEP::not_last
177 typename AUX_LAST_FORWARD_STEP::iterator
178 ,
typename AUX_LAST_FORWARD_STEP::state
184 , iter_fold_if_null_step<
185 typename AUX_LAST_FORWARD_STEP::iterator
186 ,
typename AUX_LAST_FORWARD_STEP::state
188 >::type AUX_LAST_BACKWARD_STEP;
192 , AUX_ITER_FOLD_BACKWARD_STEP
198 typedef typename AUX_LAST_BACKWARD_STEP::iterator
iterator;
201 # undef AUX_LAST_BACKWARD_STEP
202 # undef AUX_LAST_FORWARD_STEP
203 # undef AUX_ITER_FOLD_BACKWARD_STEP
204 # undef AUX_ITER_FOLD_BACKWARD_STEP_FUNC
205 # undef AUX_ITER_FOLD_FORWARD_STEP
209 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
210 #endif // BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED