...one of the most highly
regarded and expertly designed C++ library projects in the
world. — Herb Sutter and Andrei
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,
is your friend.
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
template functions. Each
function generates a suitable binder object.