iter_fold_if_impl.hpp
Go to the documentation of this file.
1 
2 #ifndef BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED
3 #define BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED
4 
5 // Copyright Aleksey Gurtovoy 2001-2004
6 // Copyright David Abrahams 2001-2002
7 //
8 // Distributed under the Boost Software License, Version 1.0.
9 // (See accompanying file LICENSE_1_0.txt or copy at
10 // http://www.boost.org/LICENSE_1_0.txt)
11 //
12 // See http://www.boost.org/libs/mpl for documentation.
13 
14 // $Id: iter_fold_if_impl.hpp 13472 2017-08-22 07:53:44Z richean $
15 // $Date: 2017-08-22 09:53:44 +0200 (Di, 22 Aug 2017) $
16 // $Revision: 13472 $
17 
18 #if !defined(BOOST_MPL_PREPROCESSING_MODE)
19 # include <boost/mpl/identity.hpp>
20 # include <boost/mpl/next.hpp>
21 # include <boost/mpl/if.hpp>
22 # include <boost/mpl/apply.hpp>
24 #endif
25 
27 
28 #if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
29  && !defined(BOOST_MPL_PREPROCESSING_MODE)
30 
31 # define BOOST_MPL_PREPROCESSED_HEADER iter_fold_if_impl.hpp
33 
34 #else
35 
42 
43 namespace boost { namespace mpl { namespace aux {
44 
45 template< typename Iterator, typename State >
46 struct iter_fold_if_null_step
47 {
48  typedef State state;
49  typedef Iterator iterator;
50 };
51 
52 template< bool >
53 struct iter_fold_if_step_impl
54 {
55  template<
56  typename Iterator
57  , typename State
58  , typename StateOp
59  , typename IteratorOp
60  >
61  struct result_
62  {
64  typedef typename IteratorOp::type iterator;
65  };
66 };
67 
68 template<>
69 struct iter_fold_if_step_impl<false>
70 {
71  template<
72  typename Iterator
73  , typename State
74  , typename StateOp
75  , typename IteratorOp
76  >
77  struct result_
78  {
79  typedef State state;
80  typedef Iterator iterator;
81  };
82 };
83 
84 // agurt, 25/jun/02: MSVC 6.5 workaround, had to get rid of inheritance
85 // here and in 'iter_fold_if_backward_step', because sometimes it interfered
86 // with the "early template instantiation bug" in _really_ ugly ways
87 template<
88  typename Iterator
89  , typename State
90  , typename ForwardOp
91  , typename Predicate
92  >
93 struct iter_fold_if_forward_step
94 {
96  typedef typename iter_fold_if_step_impl<
98  >::template result_< Iterator,State,ForwardOp,mpl::next<Iterator> > impl_;
99 
100  typedef typename impl_::state state;
101  typedef typename impl_::iterator iterator;
102 };
103 
104 template<
105  typename Iterator
106  , typename State
107  , typename BackwardOp
108  , typename Predicate
109  >
110 struct iter_fold_if_backward_step
111 {
113  typedef typename iter_fold_if_step_impl<
115  >::template result_< Iterator,State,BackwardOp,identity<Iterator> > impl_;
116 
117  typedef typename impl_::state state;
118  typedef typename impl_::iterator iterator;
119 };
120 
121 
122 // local macros, #undef-ined at the end of the header
123 
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 \
128  , ForwardOp \
129  , ForwardPredicate \
130  > BOOST_PP_CAT(forward_step, BOOST_PP_INC(i)); \
131 
132 
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 \
137  , BackwardOp \
138  , BackwardPredicate \
139  > BOOST_PP_CAT(backward_step,BOOST_PP_DEC(i)); \
140 
141 
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) \
145  ) \
146 
147 
148 # define AUX_LAST_FORWARD_STEP \
149  BOOST_PP_CAT(forward_step, BOOST_MPL_LIMIT_UNROLLING) \
150 
151 
152 # define AUX_LAST_BACKWARD_STEP \
153  BOOST_PP_CAT(backward_step, BOOST_MPL_LIMIT_UNROLLING) \
154 
155 
156 template<
157  typename Iterator
158  , typename State
159  , typename ForwardOp
160  , typename ForwardPredicate
161  , typename BackwardOp
162  , typename BackwardPredicate
163  >
164 struct iter_fold_if_impl
165 {
166  private:
167  typedef iter_fold_if_null_step<Iterator,State> forward_step0;
170  , AUX_ITER_FOLD_FORWARD_STEP
171  , unused
172  )
173 
174  typedef typename if_<
175  typename AUX_LAST_FORWARD_STEP::not_last
176  , iter_fold_if_impl<
177  typename AUX_LAST_FORWARD_STEP::iterator
178  , typename AUX_LAST_FORWARD_STEP::state
179  , ForwardOp
180  , ForwardPredicate
181  , BackwardOp
182  , BackwardPredicate
183  >
184  , iter_fold_if_null_step<
185  typename AUX_LAST_FORWARD_STEP::iterator
186  , typename AUX_LAST_FORWARD_STEP::state
187  >
188  >::type AUX_LAST_BACKWARD_STEP;
189 
192  , AUX_ITER_FOLD_BACKWARD_STEP
193  , unused
194  )
195 
196  public:
197  typedef typename backward_step0::state state;
198  typedef typename AUX_LAST_BACKWARD_STEP::iterator iterator;
199 };
200 
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
206 
207 }}}
208 
209 #endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
210 #endif // BOOST_MPL_AUX_ITER_FOLD_IF_IMPL_HPP_INCLUDED
identity.hpp
boost::mpl::aux::iter_fold_if_impl::iterator
backward_step4::iterator iterator
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:130
use_preprocessed.hpp
boost::mpl::aux::iter_fold_if_forward_step::iterator
impl_::iterator iterator
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:68
boost::mpl::aux::iter_fold_if_backward_step::impl_
iter_fold_if_step_impl< BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value >::template result_< Iterator, State, BackwardOp, identity< Iterator > > impl_
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:82
value_wknd.hpp
BOOST_MPL_AUX_MSVC_VALUE_WKND
#define BOOST_MPL_AUX_MSVC_VALUE_WKND(C)
Definition: value_wknd.hpp:58
boost::mpl::aux::iter_fold_if_forward_step::not_last
apply2< Predicate, State, Iterator >::type not_last
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:62
boost
BOOST_MOVE_USE_STANDARD_LIBRARY_MOVE.
boost::mpl::aux::iter_fold_if_impl::state
backward_step0::state state
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:129
sub.hpp
boost::mpl::aux::iter_fold_if_backward_step::iterator
impl_::iterator iterator
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:85
cat.hpp
BOOST_MPL_LIMIT_UNROLLING
#define BOOST_MPL_LIMIT_UNROLLING
Definition: unrolling.hpp:18
inc.hpp
boost::mpl::aux::iter_fold_if_forward_step::impl_
iter_fold_if_step_impl< BOOST_MPL_AUX_MSVC_VALUE_WKND(not_last)::value >::template result_< Iterator, State, ForwardOp, mpl::next< Iterator > > impl_
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:65
apply.hpp
include_preprocessed.hpp
boost::mpl::aux::iter_fold_if_null_step::state
State state
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:18
BOOST_PP_REPEAT
#define BOOST_PP_REPEAT
Definition: preprocessor/repetition/repeat.hpp:29
boost::mpl::aux::iter_fold_if_forward_step::state
impl_::state state
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:67
boost::mpl::aux::iter_fold_if_backward_step::state
impl_::state state
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:84
boost::mpl::apply2::type
apply_wrap2< typename lambda< F >::type, T1, T2 >::type type
Definition: aux_/preprocessed/msvc60/apply.hpp:73
boost::mpl::aux::iter_fold_if_backward_step::not_last
apply2< Predicate, State, Iterator >::type not_last
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:79
boost::mpl::aux::iter_fold_if_step_impl::result_::state
apply2< StateOp, State, Iterator >::type state
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:33
next.hpp
boost::mpl::aux::iter_fold_if_step_impl::result_::iterator
IteratorOp::type iterator
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:34
unrolling.hpp
repeat.hpp
boost::mpl::aux::iter_fold_if_null_step::iterator
Iterator iterator
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:19
dec.hpp
if.hpp
boost::mpl::aux::iter_fold_if_impl::forward_step0
iter_fold_if_null_step< Iterator, State > forward_step0
Definition: preprocessed/bcc/iter_fold_if_impl.hpp:99


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:40:27