Reader-supported: when you buy through links on our site, we may earn an affiliate commission. Learn more

Cover of The C++ standard library
Buy on AmazonBuy on Bookshop.orgListen on Audible

We earn a commission if you buy through these links. Learn more

The C++ standard library

by Nicolai M. Josuttis

A dense but authoritative tour of C++'s standard library that pairs a readable tutorial with a detailed reference, useful for anyone who writes C++ daily.

What It's About

The book is a tutorial and reference for the library portion of standard C++: the containers, iterators, algorithms, function objects, strings, streams, and utilities that ship with a compiler. Josuttis aims to show not only what each component does but how the pieces are meant to combine, so the early sections read as a guided walk and the later sections work as a lookup manual. Expect a long book organized around that split. Few readers go cover to cover; most dip in when they need a specific class or algorithm.

The writing is methodical and precise rather than chatty. Examples are small, compilable, and focused on one behavior at a time, and the text spends real effort on the details that trip up working programmers: iterator invalidation rules, complexity guarantees, and the difference between what the standard requires and what an implementation happens to do. Reading it feels closer to working alongside a careful colleague than being entertained, which suits people who learn by typing code and checking results.

Because the library has grown with each language revision, the book's value depends on which edition you hold. The later edition covers the C++11 additions, so check that the coverage matches the language version you target. Treat it as a companion to your compiler's documentation and your own experiments rather than a substitute for them.

Read this if you…

  • write C++ professionally and want a single trustworthy reference for the standard library
  • learn best by reading precise explanations alongside small, testable examples
  • want to understand why the containers and algorithms behave the way they do, not just how to call them

Skip it if you…

  • are new to C++ and need the language basics first, since the book assumes you can already write and compile code
  • want a short, opinionated guide to modern C++ style rather than a comprehensive catalogue of library components

Key Ideas

  1. 1

    Choose containers by their guarantees

    The book keeps returning to the question of what a container promises: how fast insertion and lookup are, whether iterators stay valid after changes, and how memory is laid out. Picking a container becomes a matter of matching those promises to your access pattern, rather than defaulting to the one you know best. This framing turns the container chapters from a list of classes into a decision guide.

  2. 2

    Iterators are the glue of the library

    Containers and algorithms never talk to each other directly; they meet through iterators. Once you see iterators as a common vocabulary for position and traversal, the rest of the library starts to feel like one design rather than a pile of unrelated parts. The book's treatment of iterator categories explains why some operations are fast on one container and unavailable on another.

  3. 3

    Algorithms work on ranges, not containers

    Standard algorithms take a pair of iterators and operate on whatever sequence lies between them. This means the same search or sort code works across containers and even raw arrays, and it explains why algorithms rarely change the size of what they touch. Understanding this separation is one of the most practical lessons the book offers.

  4. 4

    Know the contract, not just the call

    Much of the value lies in the small print: exception guarantees, complexity requirements, and rules about when references and iterators remain usable. The book encourages you to read these as obligations the implementation must meet, which helps you write code that is correct under portability constraints rather than merely correct on your machine.

Limitations

The book is long and dense, and much of it is reference material that is easier to consult than to read through. It concentrates on the library rather than on language design, program architecture, or idioms for writing large systems, so you will need other sources for those. Because the library keeps changing, parts of the text can lag behind the newest standard, and the later features need checking against current compiler documentation. Some readers find the tone too careful and the pace too slow for quick learning, while others see that same thoroughness as its main strength.

Questions Readers Ask

Who is this book best suited for?
It suits working C++ developers who already know the core language and want a thorough, reliable guide to the standard library. It is also useful for students who have finished an introductory course and are ready to use containers and algorithms seriously. Beginners will find it hard going without a basic C++ text alongside it.
Is it still relevant with newer C++ standards?
The core design of the containers, iterators, and algorithms remains valid, so much of the book still applies. However, later standards added library features that a reader should look up separately, and newer editions or online references cover them better. Use the book for fundamentals and check current documentation for anything added after the edition you own.
Published
1999
ISBN
9780201379266
Difficulty
intermediate
Category
Tech

Book details and cover from Google Books.

Ready to read The C++ standard library?

Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.

Explore More