Library 10. Lambda

How Does the Lambda Library Improve Your Programs?

• Adapts functions and function objects for use with Standard Library algorithms

• Binds arguments to function calls

• Transforms arbitrary expressions into function objects compatible with the Standard Library algorithms

• Defines unnamed functions at the call site, thereby improving readability and maintainability of the code

• Implements predicates when and where needed

When using the Standard Library, or any library employing a similar design that relies on algorithmic configuration by the means of functions and function objects, one often ends up writing lots of small function objects that perform quite trivial operations. As we saw in “Library 9: Bind 9,” this can quickly ...

Get Beyond the C++ Standard Library: An Introduction to Boost now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.