C++ gives the programmer manual control over memory and machine representation, then hands back safety through library and language conventions rather than a checker: RAII ties resource lifetime to scope, smart pointers encode ownership in the type, and templates generate specialized code at compile time. The cost of that control is a large surface of undefined behavior, where the standard declines to say what happens and the compiler is free to assume it never occurs.

It is also the oldest generics system in this section, and the strangest. A template is not a generic type. It is a compile-time substitution mechanism that turned out to be Turing complete by accident, grew an entire style of type-level programming out of a defensive rule about failed deduction, and then spent twenty years acquiring a way to say what a parameter is supposed to be. The folder follows that arc, from what substitution actually does, through the overload-resolution machinery it turned into, to concepts.

Object lifetime and the value model

The half of C++ that is not templates. Read it first; the template notes assume it.

What a template actually is

Substitution, not parameterization. Every surprise in the next two sections comes from this one.

Choosing an implementation

Generic programming in C++98 had no way to ask a question about a type, so it built one out of overload resolution.

Constraining it

The twenty-year arc to saying what you meant.

The standard library

  • STL Containers - the three categories, the invalidation contracts, and choosing between them
  • Iterators and Ranges - iterator categories, the half-open range, and what C++20 sentinels changed
  • STL Algorithms - the algorithm and container seam, and the names worth knowing
  • The Allocator Model - why putting the allocator in the container’s type was the mistake, and what pmr moved to runtime

Dispatch, failure, and concurrency

The build model and the contract with the compiler

Read from the comparative layer


Any pages placed under this folder are auto-listed below by Quartz.

32 items under this folder.