12 #ifndef BOOST_MPL11_FUNCTIONAL_HPP
13 #define BOOST_MPL11_FUNCTIONAL_HPP
23 namespace boost {
namespace mpl11 {
31 template <
typename ...>
38 template <
typename f,
typename ...x>
40 : f::type::template
apply<x...>
50 #if defined(BOOST_MPL11_CLANG_FLIP_BUG)
51 template <
typename x0,
typename x1,
typename ...xs>
52 struct apply : f::type::template apply<x1, x0, xs...> {};
54 template <
typename x0,
typename x1,
typename ...xs>
55 using apply =
typename f::type::template apply<x1, x0, xs...>;
62 template <
typename f,
typename ...x>
66 template <
typename ...y>
67 using apply =
typename f::type::template apply<x..., y...>;
70 template <
template <
typename ...>
class f,
typename ...x>
74 #if defined(BOOST_MPL11_GCC_PACK_EXPANSION_BUG)
75 template <
typename ...y>
76 struct apply : f<x..., y...> { };
78 template <
typename ...y>
79 using apply = f<x..., y...>;
83 template <
template <
typename ...>
class f,
typename ...x>
84 struct partial<into<f>, x...> {
87 template <
typename ...y>
89 using type = f<x..., y...>;
96 template <
typename f,
typename ...xs>
104 template <detail::std_
size_t n,
typename f>
106 #if !defined(BOOST_MPL11_NO_ASSERTIONS)
108 "Invalid usage of curry<n, f> with a zero-valued n.");
113 template <
typename x>
117 template <
typename f>
121 template <
typename x>
128 template <detail::std_
size_t n,
typename f>
132 #if defined(BOOST_MPL11_NO_ASSERTIONS)
133 template <
typename ...xs>
137 "Invalid usage of uncurry<n, f> with a zero-valued n.");
139 template <
typename ...xs>
141 static_assert(
sizeof...(xs) <= n,
142 "Invalid usage of uncurry<n, f> with more than n arguments.");
144 static_assert(
sizeof...(xs) >= n,
145 "Invalid usage of uncurry<n, f> with less than n arguments.");
154 template <
template <
typename ...>
class f>
158 #if defined(BOOST_MPL11_GCC_PACK_EXPANSION_BUG)
159 template <
typename ...x>
160 struct apply : f<x...> { };
162 template <
typename ...x>
163 using apply = f<x...>;
170 template <
template <
typename ...>
class tp>
174 template <
typename ...x>
176 using type = tp<x...>;
183 template <
typename f>
191 namespace functional_detail {
192 template <
bool has_zero_args>
196 struct compose_impl<true> {
197 template <
typename f,
typename g>
198 using apply =
typename f::type::template
apply<
199 typename g::type::template
apply<>
204 struct compose_impl<false> {
205 template <
typename f,
typename g,
typename x,
typename ...xs>
206 using apply =
typename f::type::template
apply<
207 typename g::type::template
apply<x>, xs...
212 template <
typename f,
typename ...fs>
216 template <
typename ...xs>
218 typename functional_detail::compose_impl<
sizeof...(xs) == 0>::
222 template <
typename f>
228 template <
typename f,
typename g>
232 template <
typename ...x>
233 using apply =
typename f::type::template apply<
234 typename g::type::template apply<x>...
241 template <
typename f,
typename ...fs>
245 template <
typename ...x>
246 using apply =
typename f::type::template apply<
247 typename fs::type::template apply<x>...
252 template <
typename ...>
class f,
253 template <
typename ...>
class ...fs
258 template <
typename ...x>
259 using apply = f<fs<x>...>;
265 template <
typename f,
typename ...fs>
269 template <
typename ...x>
270 using apply =
typename f::type::template apply<
271 typename fs::type::template apply<x...>...
276 template <
typename ...>
class f,
277 template <
typename ...>
class ...fs
282 template <
typename ...x>
283 using apply = f<fs<x...>...>;
293 template <detail::std_
size_t n>
297 template <
typename ...an>
298 using apply = detail::at_index::best<n-1, an...>;
302 #endif // !BOOST_MPL11_FUNCTIONAL_HPP
Returns a specialization of the given template with the provided arguments.
Definition: functional.hpp:171
Forward declares the Functional module.
Returns a metafunction class computing the least fixed point of f.
Definition: functional.hpp:184
Returns a curried metafunction class.
Definition: functional.hpp:105
Lifts a metafunction.
Definition: functional.hpp:155
Invokes f with the result of invoking each fs... with the arguments.
Definition: functional.hpp:266
Manages configurable options of the library and defines utility macros.
Defines boost::mpl11::detail::std_size_t.
Invokes f with the result of invoking fs... on each corresponding argument.
Definition: functional.hpp:242
Returns a uncurried metafunction class.
Definition: functional.hpp:129
Returns the nth of its arguments.
Definition: functional.hpp:294
Returns a constant metafunction class returning x regardless of the arguments it is invoked with...
Definition: functional.hpp:28
Defines boost::mpl11::detail::left_folds::variadic.
Returns the composition of several metafunction classes.
Definition: functional.hpp:213
Returns a partially applied metafunction class.
Definition: functional.hpp:63
Recursive alias-based variadic left fold.
Definition: variadic_aliased.hpp:111
Returns a metafunction class invoking f with its two first arguments in reverse order.
Definition: functional.hpp:47
Invokes a metafunction class with the given arguments.
Definition: functional.hpp:39
Invokes f with the result of mapping g on each argument.
Definition: functional.hpp:229
Invokes a curried metafunction class with the given arguments.
Definition: functional.hpp:97
Defines boost::mpl11::detail::at_index::best.