File indexing completed on 2025-01-18 09:41:07
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 namespace boost { namespace mpl { namespace aux {
0014
0015 template< typename Iterator, typename State >
0016 struct iter_fold_if_null_step
0017 {
0018 typedef State state;
0019 typedef Iterator iterator;
0020 };
0021
0022 template< bool >
0023 struct iter_fold_if_step_impl
0024 {
0025 template<
0026 typename Iterator
0027 , typename State
0028 , typename StateOp
0029 , typename IteratorOp
0030 >
0031 struct result_
0032 {
0033 typedef typename apply2< StateOp,State,Iterator >::type state;
0034 typedef typename IteratorOp::type iterator;
0035 };
0036 };
0037
0038 template<>
0039 struct iter_fold_if_step_impl<false>
0040 {
0041 template<
0042 typename Iterator
0043 , typename State
0044 , typename StateOp
0045 , typename IteratorOp
0046 >
0047 struct result_
0048 {
0049 typedef State state;
0050 typedef Iterator iterator;
0051 };
0052 };
0053
0054 template<
0055 typename Iterator
0056 , typename State
0057 , typename ForwardOp
0058 , typename Predicate
0059 >
0060 struct iter_fold_if_forward_step
0061 {
0062 typedef typename apply2< Predicate,State,Iterator >::type not_last;
0063 typedef typename iter_fold_if_step_impl<
0064 BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value
0065 >::template result_< Iterator,State,ForwardOp, mpl::next<Iterator> > impl_;
0066
0067 typedef typename impl_::state state;
0068 typedef typename impl_::iterator iterator;
0069 };
0070
0071 template<
0072 typename Iterator
0073 , typename State
0074 , typename BackwardOp
0075 , typename Predicate
0076 >
0077 struct iter_fold_if_backward_step
0078 {
0079 typedef typename apply2< Predicate,State,Iterator >::type not_last;
0080 typedef typename iter_fold_if_step_impl<
0081 BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value
0082 >::template result_< Iterator,State,BackwardOp, identity<Iterator> > impl_;
0083
0084 typedef typename impl_::state state;
0085 typedef typename impl_::iterator iterator;
0086 };
0087
0088 template<
0089 typename Iterator
0090 , typename State
0091 , typename ForwardOp
0092 , typename ForwardPredicate
0093 , typename BackwardOp
0094 , typename BackwardPredicate
0095 >
0096 struct iter_fold_if_impl
0097 {
0098 private:
0099 typedef iter_fold_if_null_step< Iterator,State > forward_step0;
0100 typedef iter_fold_if_forward_step< typename forward_step0::iterator, typename forward_step0::state, ForwardOp, ForwardPredicate > forward_step1;
0101 typedef iter_fold_if_forward_step< typename forward_step1::iterator, typename forward_step1::state, ForwardOp, ForwardPredicate > forward_step2;
0102 typedef iter_fold_if_forward_step< typename forward_step2::iterator, typename forward_step2::state, ForwardOp, ForwardPredicate > forward_step3;
0103 typedef iter_fold_if_forward_step< typename forward_step3::iterator, typename forward_step3::state, ForwardOp, ForwardPredicate > forward_step4;
0104
0105
0106 typedef typename if_<
0107 typename forward_step4::not_last
0108 , iter_fold_if_impl<
0109 typename forward_step4::iterator
0110 , typename forward_step4::state
0111 , ForwardOp
0112 , ForwardPredicate
0113 , BackwardOp
0114 , BackwardPredicate
0115 >
0116 , iter_fold_if_null_step<
0117 typename forward_step4::iterator
0118 , typename forward_step4::state
0119 >
0120 >::type backward_step4;
0121
0122 typedef iter_fold_if_backward_step< typename forward_step3::iterator, typename backward_step4::state, BackwardOp, BackwardPredicate > backward_step3;
0123 typedef iter_fold_if_backward_step< typename forward_step2::iterator, typename backward_step3::state, BackwardOp, BackwardPredicate > backward_step2;
0124 typedef iter_fold_if_backward_step< typename forward_step1::iterator, typename backward_step2::state, BackwardOp, BackwardPredicate > backward_step1;
0125 typedef iter_fold_if_backward_step< typename forward_step0::iterator, typename backward_step1::state, BackwardOp, BackwardPredicate > backward_step0;
0126
0127
0128 public:
0129 typedef typename backward_step0::state state;
0130 typedef typename backward_step4::iterator iterator;
0131 };
0132
0133 }}}