Contents

Chapter 27

Ownership, Destructors Doing the Work

RAII and unique_ptr.

Part 2

This chapter needs a key

Chapter 26 left you responsible for remembering a delete on every path out of every function. This chapter hands that job to the language, and explains why you never had to close a file.

You'll build: Watch things clean up after themselves. Make a class announce its own birth and death, then trace the order through every exit.

Part 1, chapters 0 to 21, is free and always will be.