24 #ifndef CONTROL_HPP_INCLUDED
25 #define CONTROL_HPP_INCLUDED
31 #include <type_traits>
47 template <
class Begin,
class End,
class Transform,
class...Args>
50 static void eval(Args ...args)
53 typedef typename apply<Transform, typename deref<Begin>::type>::type cur;
58 typename next<Begin>::type,
67 template <
class End,
class Transform,
class...Args>
68 struct call_each_impl<End, End, Transform, Args...>
70 static void eval(Args...) { }
80 template <
class Seq,
class Transform,
class...Args>
81 static void call_each(Args...args)
83 internal::call_each_impl<
84 typename begin<Seq>::type,
85 typename end<Seq>::type,
101 template <
class Begin,
class End,
class SeqIn,
class Transform,
class...Args>
102 struct d_call_each_impl
105 typedef typename lambda<Transform>::type::template apply<
106 typename deref<Begin>::type,
_1
107 > partially_evaluated_transform;
109 static void eval(Args...args)
114 partially_evaluated_transform,
119 typename next<Begin>::type,
130 template <
class End,
class SeqIn,
class Transform,
class...Args>
131 struct d_call_each_impl<End, End, SeqIn, Transform, Args...>
133 static void eval(Args...) {}
145 template <
class SeqOut,
class SeqIn,
class Transform,
class...Args>
146 static void d_call_each(Args...args)
148 internal::d_call_each_impl<
149 typename begin<SeqOut>::type,
150 typename end<SeqOut>::type,
166 template <
class Begin,
class End,
class Transform,
class...Args>
167 struct call_until_impl
169 static bool eval(Args...args)
171 typedef typename apply<Transform, typename deref<Begin>::type>::type cur;
175 return call_until_impl<
176 typename next<Begin>::type,
187 template <
class End,
class Transform,
class...Args>
188 struct call_until_impl<End, End, Transform, Args...>
190 static bool eval(Args...) {
return false; }
200 template <
class Seq,
class Transform,
class...Args>
201 static bool call_until(Args...args)
203 return internal::call_until_impl<
204 typename begin<Seq>::type,
205 typename end<Seq>::type,