The C++ Substrate
RAII and deterministic lifetimes, value semantics and smart-pointer ownership, and proving a design works with GoogleTest before the patterns chapters begin.
RAII and deterministic lifetimes
Tying a resource's lifetime to an object's lifetime instead of a bool flag a caller has to remember: acquire in the constructor, release in the destructor, exception-safe by construction, taught against a warehouse dock-bay lease and a general-purpose scope-exit utility.
Value semantics, ownership, and smart pointers
Four ownership shapes in a warehouse dispatch system: a value type that follows the Rule of Zero, sole ownership transferred by move with unique_ptr, a resource-owning Rule of Five type shared by shared_ptr, and a parent/child object graph where weak_ptr breaks a reference cycle.
Proving it works: testing with GoogleTest
The shared testing foundation every pattern in this book is verified against: GoogleTest fixtures, parameterized and typed tests, GoogleMock interaction tests, and death tests, taught against a freight carrier's quote intake component.