The C++ Textbook

Progress

This book is being written a chapter at a time. Every chapter below is already outlined with its objectives fixed; the ones marked written have their prose, runnable examples, and diagrams in place.

84/84chapters written
100%of the book
124,138words
205problems

Part 1 · Foundations

6 of 6
ChapterStateWordsProblems
Hello, machine written 1,338 2
Values, types, and names written 1,521 2
Making decisions written 1,033 2
Repetition written 1,046 2
Functions written 1,244 2
Your toolchain written 1,502 1

Part 2 · Memory and objects

7 of 7
ChapterStateWordsProblems
Objects and storage written 1,612 1
Pointers written 1,785 2
References written 1,350 2
Lifetime and scope written 1,543 1
The stack and the heap written 1,547 2
Arrays, and why they decay written 1,185 1
const and constness written 1,296 1

Part 3 · Types you make

8 of 8
ChapterStateWordsProblems
Structs and classes written 1,217 1
RAII written 1,805 2
Copying written 1,609 1
Moving written 1,621 2
Rule of zero, three, five written 1,306 1
Operator overloading written 1,058 2
Inheritance and virtual functions written 1,168 2
When not to use inheritance written 1,130 1

Part 4 · The standard library

9 of 9
ChapterStateWordsProblems
std::string and text written 1,625 2
Sequence containers written 1,864 2
Associative containers written 1,371 2
Iterators written 1,251 2
Algorithms written 1,080 2
Ranges and views written 1,285 2
Smart pointers written 1,838 2
optional, variant, expected written 1,267 2
Input, output, formatting written 1,038 2

Part 5 · Generic programming

8 of 8
ChapterStateWordsProblems
Function templates written 1,076 2
Class templates written 911 2
Deduction and forwarding written 1,036 2
Concepts and constraints written 1,193 2
Compile-time computation written 1,659 2
Variadic templates written 1,542 2
Type traits written 1,594 2
Static polymorphism written 1,667 2

Part 6 · Correctness

6 of 6
ChapterStateWordsProblems
Exceptions written 1,158 2
Error handling without exceptions written 1,099 2
Undefined behaviour written 1,575 2
Testing written 1,212 2
Debugging written 1,382 1
Invariants and assertions written 1,107 1

Part 7 · Performance

6 of 6
ChapterStateWordsProblems
What the compiler does written 2,107 2
Measuring written 1,725 2
Cache and layout written 1,607 2
Zero-cost, examined written 1,668 2
Copies and elision written 1,487 2
Inlining and linking written 1,962 2

Part 8 · Concurrency

5 of 5
ChapterStateWordsProblems
Threads written 1,565 2
Races and mutexes written 1,940 2
Atomics written 2,014 2
Futures and tasks written 1,380 2
Coroutines written 1,746 2

Part 9 · Building real software

5 of 5
ChapterStateWordsProblems
Translation units written 1,966 2
Modules written 1,583 2
Build systems written 1,532 2
Dependencies written 1,701 2
Project: search index written 1,856 2

Part 10 · Problem solving

24 of 24
ChapterStateWordsProblems
Reading a problem written 1,907 4
Counting the work written 1,583 4
Template and fast I/O written 1,632 3
Sorting and comparators written 1,466 4
Binary search written 1,555 4
Two pointers written 1,201 4
Prefix sums written 1,997 4
Monotonic stacks written 1,720 4
Monotonic deques written 1,564 4
Hashing and counting written 1,597 4
Recursion written 1,516 4
Bitmasks written 1,487 4
Greedy written 1,375 4
Divide and conquer written 1,431 4
Meet in the middle written 1,456 4
Representing graphs written 1,372 4
BFS written 1,391 4
DFS written 1,449 4
Topological order written 1,313 4
Union-Find written 1,309 4
Dijkstra written 1,422 4
Negative weights written 1,411 4
Spanning trees written 1,674 4
Tree DP written 1,725 4