3 ms·
The idea with exceptions and RAII, as far as I understand, is that a RAII object, reachable through normal program flow, is always valid. This also means that w
by pandaman 11y ago
The idea with exceptions and RAII, as far as I understand, is that a RAII object, reachable through normal program flow, is always valid. This also means that we don't care about errors in destructors since an object is not reachable through normal flow at the time the destructor is executed so such an error does not have to be handled immediately and can be deferred.
Without exceptions though your RAII objects can be invalid and, frankly, should be called something like RAIIUEH (Resource Allocation Is Initialization Unless Error Happened).