25 #ifndef LAMBDA_HPP_INCLUDED
26 #define LAMBDA_HPP_INCLUDED
28 #include <type_traits>
33 template <
unsigned N,
class T,
class ...Args>
37 template <
class T,
class ...Args>
50 template <
class...Args>
85 template <
class T,
class...Args>
91 template <
class First,
class...Args>
97 template <
class...Args>
107 template <
class...Args>
112 template <
class T,
class...Args>
114 typename isPlaceholderExpression<T>::type,
119 template <
template <
class...Args>
class MF, class...Args>
131 template <
unsigned N>
132 struct lambda_plExp<
arg<N> >
136 template <
class...Args>
143 template <
template <
class a>
class MetaFun,
class a1>
144 struct lambda_plExp<MetaFun<a1> >
148 template <
class...Args>
151 typename lambda_plExp<a1>::type::template apply<Args...>::type
160 template <
class BOOL,
class a,
class...Args>
161 struct cond_eval_arg;
164 template <
class a,
class...Args>
165 struct cond_eval_arg<std::true_type, a, Args...> :
166 lambda_plExp<a>::type::template apply<Args...> {};
169 template <
class a,
class...Args>
170 struct cond_eval_arg<std::false_type, a, Args...>
176 template <
template <
class a,
class b>
class MetaFun,
class a1,
class a2>
177 struct lambda_plExp<MetaFun<a1, a2> >
181 template <
class A1 =
void_,
class A2 =
void_>
182 struct apply : MetaFun<
183 typename cond_eval_arg<
184 typename isPlaceholderExpression<a1>::type,
187 typename cond_eval_arg<
188 typename isPlaceholderExpression<a2>::type,
196 template <
template <
class a1,
class a2,
class a3>
class MetaFun,
class a1,
class a2,
class a3>
197 struct lambda_plExp<MetaFun<a1, a2, a3> >
201 template <
class A1 =
void_,
class A2 =
void_>
202 struct apply : MetaFun<
203 typename cond_eval_arg<
204 typename isPlaceholderExpression<a1>::type,
207 typename cond_eval_arg<
208 typename isPlaceholderExpression<a2>::type,
211 typename cond_eval_arg<
212 typename isPlaceholderExpression<a3>::type,
228 isPlaceholderExpression<Exp>::type::value,
229 typename internal::lambda_plExp<Exp>::type,
238 template <
class Fun,
class...Args>