We can go one step further than simple destructors. We can create structs that can give the user temporary access to some resource or functionality and automatically revoke it again when the user is done. This concept is called RAII, which stands for Resource Acquisition Is Initialization. Or, in other words, the validity of a resource is tied to the lifetime of a variable.




















































