1
2// Copyright Aleksey Gurtovoy 2001-2004
3// Copyright David Abrahams 2001-2002
4//
5// Distributed under the Boost Software License, Version 1.0.
6// (See accompanying file LICENSE_1_0.txt or copy at
7// http://www.boost.org/LICENSE_1_0.txt)
8//
9
10// Preprocessed version of "boost/mpl/aux_/iter_fold_if_impl.hpp" header
11// -- DO NOT modify by hand!
12
13namespace boost { namespace mpl { namespace aux {
14
15template< typename Iterator, typename State >
16struct iter_fold_if_null_step
17{
18 typedef State state;
19 typedef Iterator iterator;
20};
21
22template< bool >
23struct iter_fold_if_step_impl
24{
25 template<
26 typename Iterator
27 , typename State
28 , typename StateOp
29 , typename IteratorOp
30 >
31 struct result_
32 {
33 typedef typename apply2< StateOp,State,Iterator >::type state;
34 typedef typename IteratorOp::type iterator;
35 };
36};
37
38template<>
39struct iter_fold_if_step_impl<false>
40{
41 template<
42 typename Iterator
43 , typename State
44 , typename StateOp
45 , typename IteratorOp
46 >
47 struct result_
48 {
49 typedef State state;
50 typedef Iterator iterator;
51 };
52};
53
54template<
55 typename Iterator
56 , typename State
57 , typename ForwardOp
58 , typename Predicate
59 >
60struct iter_fold_if_forward_step
61{
62 typedef typename apply2< Predicate,State,Iterator >::type not_last;
63 typedef typename iter_fold_if_step_impl<
64 BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value
65 >::template result_< Iterator,State,ForwardOp, mpl::next<Iterator> > impl_;
66
67 typedef typename impl_::state state;
68 typedef typename impl_::iterator iterator;
69};
70
71template<
72 typename Iterator
73 , typename State
74 , typename BackwardOp
75 , typename Predicate
76 >
77struct iter_fold_if_backward_step
78{
79 typedef typename apply2< Predicate,State,Iterator >::type not_last;
80 typedef typename iter_fold_if_step_impl<
81 BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value
82 >::template result_< Iterator,State,BackwardOp, identity<Iterator> > impl_;
83
84 typedef typename impl_::state state;
85 typedef typename impl_::iterator iterator;
86};
87
88template<
89 typename Iterator
90 , typename State
91 , typename ForwardOp
92 , typename ForwardPredicate
93 , typename BackwardOp
94 , typename BackwardPredicate
95 >
96struct iter_fold_if_impl
97{
98 private:
99 typedef iter_fold_if_null_step< Iterator,State > forward_step0;
100 typedef iter_fold_if_forward_step< typename forward_step0::iterator, typename forward_step0::state, ForwardOp, ForwardPredicate > forward_step1;
101 typedef iter_fold_if_forward_step< typename forward_step1::iterator, typename forward_step1::state, ForwardOp, ForwardPredicate > forward_step2;
102 typedef iter_fold_if_forward_step< typename forward_step2::iterator, typename forward_step2::state, ForwardOp, ForwardPredicate > forward_step3;
103 typedef iter_fold_if_forward_step< typename forward_step3::iterator, typename forward_step3::state, ForwardOp, ForwardPredicate > forward_step4;
104
105
106 typedef typename if_<
107 typename forward_step4::not_last
108 , iter_fold_if_impl<
109 typename forward_step4::iterator
110 , typename forward_step4::state
111 , ForwardOp
112 , ForwardPredicate
113 , BackwardOp
114 , BackwardPredicate
115 >
116 , iter_fold_if_null_step<
117 typename forward_step4::iterator
118 , typename forward_step4::state
119 >
120 >::type backward_step4;
121
122 typedef iter_fold_if_backward_step< typename forward_step3::iterator, typename backward_step4::state, BackwardOp, BackwardPredicate > backward_step3;
123 typedef iter_fold_if_backward_step< typename forward_step2::iterator, typename backward_step3::state, BackwardOp, BackwardPredicate > backward_step2;
124 typedef iter_fold_if_backward_step< typename forward_step1::iterator, typename backward_step2::state, BackwardOp, BackwardPredicate > backward_step1;
125 typedef iter_fold_if_backward_step< typename forward_step0::iterator, typename backward_step1::state, BackwardOp, BackwardPredicate > backward_step0;
126
127
128 public:
129 typedef typename backward_step0::state state;
130 typedef typename backward_step4::iterator iterator;
131};
132
133}}}
134