...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Creates a fused_function_object
adapter
for a given Deferred
Callable Object. The usual element
conversion is applied to the target function.
template <typename F>
inline typename make_fused_function_object
<F>::type
make_fused_function_object(F const & f);
Parameter |
Requirement |
Description |
---|---|---|
|
Model of Polymorphic Function Object |
The function to transform. |
make_fused_function_object(f);
Return type: A specialization of fused_function_object
.
Semantics: Returns a fused_function_object
adapter
for f
.
#include <boost/fusion/functional/generation/make_fused_function_object.hpp> #include <boost/fusion/include/make_fused_function_object.hpp>
struct sub { template <typename Sig> struct result; template <class Self, typename T> struct result< Self(T,T) > { typedef typename remove_reference<T>::type type; }; template<typename T> T operator()(T lhs, T rhs) const { return lhs - rhs; } }; void try_it() {vector
<int,float> a(2,2.0f);vector
<int,float> b(1,1.5f);vector
<int,float> c(1,0.5f); assert(c ==transform
(zip
(a,b), make_fused_function_object(sub()))); }