Resource Acquisition Is Initialization or RAII, is a C++ programming technique (C++ Style and Technique FAQ, isocpp/CppCoreGuidelines) which binds the life cycle of a resource (allocated memory, thread of execution, open socket, open file, locked mutex, database connection—anything that exists in limited supply) to the lifetime of an object.