Chapter 11. Standard Template Library

The Standard Template Library (STL) is a powerful combination of containers and generic algorithms. From a performance perspective, a few questions immediately come to mind:

  • The STL comes bundled with performance guarantees of the asymptotic complexity of the various containers and algorithms. What does it really mean?

  • The STL consists of many containers. Faced with a given computational task, what containers should I use? Are some better than others for a given scenario?

  • How good is the performance of the STL? Can I do better by rolling my own home-grown containers and algorithms?

We will address these and other related issues in this chapter.

Even though we often refer to “the STL performance,” it should ...

Get Efficient C++ Performance Programming Techniques 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.