This matches the case of a lexically scoped variable and no moves. With full RAII, the resources are tracked across their entire dynamic lifetime, not just one lexical block, allowing them to be returned to callers, placed in containers, etc.
Not really when taking heap into account, while having the code storage agnostic, which is why you need helper classes like handles or std::unique_ptr, with move semantics, otherwise the RAII story gets rather complicated.
Replies (1)