Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
make_fused
Description

Creates a fused adapter for a given Deferred Callable Object. The usual element conversion is applied to the target function.

Synopsis
template <typename F>
inline typename result_of::make_fused<F>::type
make_fused(F const & f);
Parameters

Parameter

Requirement

Description

f

Model of Deferred Callable Object

The function to transform.

Expression Semantics
make_fused(f);

Return type: A specialization of fused.

Semantics: Returns a fused adapter for f.

Header
#include <boost/fusion/functional/generation/make_fused.hpp>
#include <boost/fusion/include/make_fused.hpp>
Example
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>())));
}
See also

PrevUpHomeNext