Boost C++ Libraries 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.

Binding Member Functions

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

Binding member functions can be done similarly. A bound member function takes in a pointer or reference to an object as the first argument. For instance, given:

struct xyz
    void foo(int) const;

xyz's foo member function can be bound as:

bind(&xyz::foo, obj, arg1) // obj is an xyz object

Take note that a lazy-member functions expects the first argument to be a pointer or reference to an object. Both the object (reference or pointer) and the arguments can be lazily bound. Examples:

xyz obj;
bind(&xyz::foo, arg1, arg2)     //
bind(&xyz::foo, obj, arg1)      //
bind(&xyz::foo, obj, 100)       //