Beyond the C++ Standard Library: An Introduction to Boost [Electronic resources]

Bjorn Karlsson

نسخه متنی -صفحه : 124/ 84
نمايش فراداده

How Does Lambda Fit with the Standard Library?

The library addresses a problem that is often encountered when using the Standard Library algorithmsthe need to define many simple function objects just to comply with the requirements of the algorithms. Almost all of the Standard Library algorithms also come in a version that accepts a function object, to perform operations such as ordering, equality, transformations, and so on. To a limited extent, the Standard Library supports functional composition, through the binders bind1st and bind2nd. However, these are very limited in what they can produce, and they provide only argument binding, not bindings for expressions. Given that both flexible support for binding arguments and for creating function objects directly from expressions are available in the Boost.Lambda library, it is an excellent companion to the C++ Standard Library.