23 #include <boost/mpl/apply.hpp>
24 #include <boost/mpl/assert.hpp>
25 #include <boost/mpl/aux_/unwrap.hpp>
26 #include <boost/mpl/begin_end.hpp>
27 #include <boost/mpl/bool.hpp>
28 #include <boost/mpl/deref.hpp>
29 #include <boost/mpl/identity.hpp>
30 #include <boost/mpl/is_sequence.hpp>
31 #include <boost/mpl/next_prior.hpp>
33 #include <boost/type_traits/is_same.hpp>
34 #include <boost/utility/value_init.hpp>
56 template <
typename Iterator,
typename LastIterator,
typename TransformFunc,
68 static bool execute(Iterator *, LastIterator *, TransformFunc *, F) {
94 template <
typename Iterator,
typename LastIterator,
typename TransformFunc,
96 static bool execute(Iterator *, LastIterator *, TransformFunc *, F f) {
97 typedef typename deref<Iterator>::type item;
98 typedef typename apply1<TransformFunc, item>::type arg;
102 value_initialized<arg> x;
104 if (aux::unwrap(f, 0)(boost::get(x))) {
105 typedef typename mpl::next<Iterator>::type iter;
107 static_cast<iter *>(0), static_cast<LastIterator *>(0),
108 static_cast<TransformFunc *>(0), f);
134 template <
typename Sequence,
typename TransformOp,
typename F>
135 inline bool exec_if(F f, Sequence * = 0, TransformOp * = 0) {
136 BOOST_MPL_ASSERT((is_sequence<Sequence>));
138 typedef typename begin<Sequence>::type first;
139 typedef typename end<Sequence>::type last;
142 static_cast<first *>(0), static_cast<last *>(0),
143 static_cast<TransformOp *>(0), f);
158 template <
typename Sequence,
typename F>
160 return exec_if<Sequence, identity<>>(f);
Default implementation of exec which returns true.
Definition: exec_if.h:55
bool exec_if(F f, Sequence *=0, TransformOp *=0)
Function to go through elements of boost sequence and apply the functor F on each element...
Definition: exec_if.h:135
static bool execute(Iterator *, LastIterator *, TransformFunc *, F f)
Definition: exec_if.h:96
static bool execute(Iterator *, LastIterator *, TransformFunc *, F)
Default implementation that returns true.
Definition: exec_if.h:68