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