Chapter 7. Programming with the STL

It’s traditional to summarize the STL as consisting of containers, iterators, algorithms, and function objects, but programming with the STL is much more than that. Programming with the STL is knowing when to use loops, when to use algorithms, and when to use container member functions. It’s knowing when equal_range is a better way to search than lower_bound, knowing when lower_bound is preferable to find, and knowing when find beats equal_range. It’s knowing how to improve algorithm performance by substituting functors for functions that do the same thing. It’s knowing how to avoid unportable or incomprehensible code. It’s even knowing how to read compiler error messages that run to thousands of characters. ...

Get Effective STL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.