Skip to content

Glossary: Data Structures and Algorithms in C++

RAII

Also written: Resource Acquisition Is Initialization

The C++ habit of tying a resource's cleanup to an object's lifetime. The std::ifstream in load_roads closes its file automatically when the function ends.

Where the book teaches it

Related terms

Ownershipstd::unique_ptr