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

Bind

Binding Function Objects
Binding Functions
Binding Member Functions
Binding Member Variables
Compatibility with Boost.Bind

Binding is the act of tying together a function to some arguments for deferred (lazy) evaluation. Named lazy functions require a bit of typing. Unlike (unnamed) lambda expressions, we need to write a functor somewhere offline, detached from the call site. If you wish to transform a plain function, member function or member variable to a lambda expression, bind is your friend.

[Note] Note

Take note that binding functions, member functions or member variables is monomorphic. Rather than binding functions, the preferred way is to write true generic and polymorphic lazy functions.

There is a set of overloaded bind template functions. Each bind(x) function generates a suitable binder object.


PrevUpHomeNext