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

PrevUpHomeNext
make_unfused
Description

Creates a unfused adapter for a given, unary Polymorphic Function Object. The usual element conversion is applied to the target function.

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

Parameter

Requirement

Description

f

Model of Polymorphic Function Object

The function to transform.

Expression Semantics
make_unfused(f);

Return type: A specialization of unfused.

Semantics: Returns a unfused adapter for f.

Header
#include <boost/fusion/functional/generation/make_unfused.hpp>
#include <boost/fusion/include/make_unfused.hpp>
Example
struct fused_incrementer
{
    template <class Seq>
    struct result
    {
        typedef void type;
    };

    template <class Seq>
    void operator()(Seq const & s) const
    {
        for_each(s,++boost::lambda::_1);
    }
};

void try_it()
{
    int a = 2; char b = 'X';
    make_unfused(fused_incrementer())(a,b);
    assert(a == 3 && b == 'Y');
}
See also

PrevUpHomeNext