O'Reilly logo

Shared Memory Application Programming by Victor Alessandrini

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Annex B

C++ Function Objects and Lambda Expressions

In C++, a callable object is an object or expression to which the call operator () can be applied. Functions and—as we will see below—function pointers are callable objects inherited from C. C++ adds two other callable types of objects, function objects and lambda expressions, which are the subject of this annex.

B.1 Function Objects

Function objects are heavily used by STL algorithms to incorporate user-defined behavior in the library. They generalize the concept of function pointers, enabling some programming capabilities that are not easily implemented with function pointers alone. We have seen that function objects are used by TBB in the STL-like algorithms implementing parallel patterns, ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required