
yinglcs2@yahoo.com wrote:
Hi,
I am new to Boost library. I wonder if the Boost functional library is a sub-set of the Boost bind library?
http://www.boost.org/libs/functional/
http://www.boost.org/libs/bind
If now, what functionality that functional library provides that bind library does not?
The functional library is a better way of using a number of adapters in the current C++ standard library for creating function objects. Bind is much more advanced, and much easier, than using the C++ standard library adapters, and is a much better paradigm for using function objects. The only adapters in the functional library you still might want to use with bind are the Negators, whereas bind very adequately replaces the rest of functional, and its original C++ standard equivalents. Bind also offers more advanced functionality, mostly having to do with argument replacement and manipulation when calling the bound (member) function. You might also want to look at Boost lambda, which is similar to the functionality which bind offers, using a different more in-line syntax, which is not intended to save the function object for later use, when calling a bound (member) function. Boost lambda needs a highly C++ compliant compiler, and a number of older or lesser C++ compliant compilers do not work with Boost lambda. A Boost bind object, which is a C++ function object, can be saved as a Boost function, for use as a callback, or used in Boost signals as a signal handler.