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

Click here to view the latest version of this page.
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