The long awaited sequel to the highly successful Thinking in C++. More coverage of advanced topics professional developers must master.
Emphasis on advanced testing techniques to produce optimized error free code.
In depth coverage of STL with real world reusable code examples.
Simple short exercises that simplify complex programming routines.
Both authors are highly respected and widely known.
AI Reading Assistant
Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
【One-Line Pitch】
A working sequel that turns intermediate C++ knowledge into professional practice: you learn the standard string and iostream libraries, template technique, and the STL by building and testing real reusable code. Best for developers who already write C++ and want the library fluency and design discipline that separate hobby code from production code.
【Book Arc】
- **Opening (~0%–10%)**: Sets the volume's scope — standard libraries plus advanced topics — and frames the book as a practical sequel, with the table of contents previewing RTTI, stable systems, and design patterns before the technical work begins.
- **Early (~10%–32%)**: Replaces C-style char handling with the standard `string` class, then moves into iostreams — formatting state, manipulators, file and string streams — solving the everyday problem of safe, leak-free text and I/O code.
- **Early–Middle (~32%–42%)**: Goes deep on templates: nontype parameters, specialization, partial ordering, and techniques like a common base class to prevent template bloat, with an explicit design-first, optimize-later workflow.
- **Middle (~42%–48%)**: Introduces the STL through containers — the container concept, sequence containers (`vector`, `deque`, `list`), reversible containers, and basic operations — showing how much code the library removes.
- **Late (beyond excerpt coverage)**: The contents list points to RTTI, building stable systems (reference counting, design by contract, unit testing), and design patterns (singleton, factories, observer, visitor, flyweight); the excerpts do not cover these chapters in detail.
- **Ending**: Not covered by the excerpts; the guide cannot describe the closing chapters.
【Key Takeaways】
- **The standard `string` class eliminates a whole class of pointer bugs** (Early): it grows storage transparently and manages the heap for you, so uninitialized and misvalued `char*` defects disappear; the excerpts also flag its limits — no single-character or integer initialization, and case-insensitive work needs `toupper`/`tolower` helpers or `compare()`.
- **Iostream formatting is stateful and full of traps** (Early): width resets after each insertion while fill and precision persist, and `cin >> buf` stops at whitespace — details that silently corrupt output if you don't know them.
- **File and string streams make I/O composable** (Early): `seekg`/`seekp`, `rdbuf()`, and `stringstream` let you read and write the same file or convert data in memory; prefer `stringstream` over legacy `strstream`.
- **Design first, optimize later** (Middle): get interfaces right and a rough implementation working to prove the design; a deliberately simple bubble sort inside a private implementation is acceptable until profiling says otherwise.
- **Templates need bloat control** (Middle): each instantiation regenerates code, so move type-independent functionality into a common base class — a concrete, reusable technique rather than a warning.
- **The STL's core idea is the container** (Middle): objects constantly move through a program and need somewhere to live; once you grasp containers and iterators, tasks like unique-word counting collapse to a few lines versus substantial C code.
- **Iterators unify containers** (Middle): `begin()`/`end()` and generic function templates let one algorithm work across `vector`, `deque`, and `list`, which is why the STL rewards learning the interface once.
- **Testing and stability are first-class topics** (Opening): the book's stated emphasis on advanced testing and the contents' unit-testing and design-by-contract material signal that correctness is treated as engineering, not afterthought.
【Reading Tips】
- Deep-read the string and iostream chapters if you still write C-style char arrays; they are the highest-return fix for real bugs.
- Treat the template chapter as the hard spot: work the short exercises on specialization and bloat prevention rather than skimming, since later STL and pattern material assumes this fluency.
- Skim the table-of-contents-only material (RTTI, stable systems, patterns) as a map for later study; the excerpts don't let this guide vouch for its depth.
- Type in and modify the small example programs — the book's pedagogy is short, runnable code — and take away the design-first workflow, not just syntax.
【Coverage Limits】
This guide is based on stratified excerpts covering roughly the first half of the book (string, iostreams, templates, early STL); the later chapters on RTTI, stable systems, and design patterns are known only from the contents listing and are not summarized here.
d there must be someplace to put them while they’re around. You can’t make named local objects because in a typical program you don’t know how many, or what...
( ) so we’re never tempted to use it. WordList2.cpp can be modified to create a class called StreamTokenizer that delivers a new token as a string whenever y...
nd_first_of", " "); Chapter 15: Multiple Inheritance 302 Once your sequence is sorted, there are many operations you can perform on that sequence, from simpl...
initial value for the inner product; this is probably zero but may be anything and is especially important for an empty first sequence, because then it becom...
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Loading comments...
Reply to Comment
Edit Comment