3 ms·
RAII is commonly used for representing smart pointers that manage references to objects that themselves have otherwise pervasive lifetimes. RAII not managing a
by kazinator 8y ago
RAII is commonly used for representing smart pointers that manage references to objects that themselves have otherwise pervasive lifetimes.
RAII not managing any shared resources is trivial and uninteresting. The lifecycle of an object that is confined to a single lexical scope can be handled manually and verified by visual inspection (though of course it is more reliable to automate that with RAII or macros, not to mention less verbose).