...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
adapter for a given Deferred Callable Object.
The usual element
conversion is applied to the target function.
template <typename F>
inline typename result_of::make_fused
<F>::type
make_fused(F const & f);
Parameter |
Requirement |
Description |
---|---|---|
|
Model of Deferred Callable Object |
The function to transform. |
make_fused(f);
Return type: A specialization of fused
.
Semantics: Returns a fused
adapter for f
.
#include <boost/fusion/functional/generation/make_fused.hpp> #include <boost/fusion/include/make_fused.hpp>
float sub(float a, float b) { return a - b; } void try_it() {vector
<int,float> a(2,2.0f);vector
<int,float> b(1,1.5f);vector
<float,float> c(1.0f,0.5f); assert(c ==transform
(zip
(a,b), make_fused(& sub))); assert(c ==transform
(zip
(a,b), make_fused(std::minus
<float>()))); }