June 2001
Intermediate to advanced
288 pages
7h 56m
English
Like it or not, functions and function-like objects—functors—pervade the STL. Associative containers use them to keep their elements in order, some algorithms (e.g., find_if) use them to control their behavior, others (e.g., for_each and transform) are meaningless without them, and adapters like not1 and bind2nd actively produce them.
Yes, everywhere you look in the STL, you see functors and functor classes. Including in your source code. It’s not possible to make effective use of the STL without knowing how to write well-behaved functors. That being the case, most of this chapter is devoted to explaining how to make your functors behave the way the STL expects them to. One Item, however, is ...
Read now
Unlock full access