Chapter 7. Higher Order and Compile-time Programming

A number of Standard Library algorithms take callable entities called function objects (function pointers, functors, and so on) as parameters. They call these function objects on individual elements of containers to compute some value or perform some action. Thus, a part of the runtime logic of the algorithm is encapsulated in a function or functor and supplied as an argument to the algorithm. A function may also return function objects instead of data values. The returned function object can be applied on a set of parameters and may in turn return either a value or another function object. This gives rise to higher order transforms. This style of programming involving passing and returning ...

Get Learning Boost C++ Libraries now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.