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

Binding Functions

#include <boost/phoenix/bind/bind_function.hpp>

Example, given a function foo:

void foo(int n)
{
    std::cout << n << std::endl;
}

Here's how the function foo may be bound:

bind(&foo, arg1)

This is now a full-fledged expression that can finally be evaluated by another function call invocation. A second function call will invoke the actual foo function. Example:

bind(&foo, arg1)(4);

will print out "4".


PrevUpHomeNext