26.5 Function Objects and the STRATEGY Pattern
26.5.1 Function Objects
- STRATEGY pattern shows how to supply a variety of algorithms to a
computation
- Motivation: the STL sort
- E.g., sorting a vector of strings:
vector<string> names;
. . .
sort(names.begin(), names.end());
prev
|top
|next