This chapter discusses in detail function objects, or functors for short, which were introduced in Section 5.9. It covers the full set of predefined function objects and function adapters, and the concept of functional composition, and provides examples of self-written function objects.
A function object (or functor), is an object that has operator
() defined so that in the following example
FunctionObjectType fo; ... fo(...);
fo() is a call of operator
() for the function object
fo instead of a call of the function
At first, you could consider a function object as an ordinary function that is written in a more complicated way: Instead of writing all the function statements ...