This is a design template that is associated with exceptions that were selected from within the constructor of the object.
In C ++, if an exception is thrown from within the costructor object, then this object is considered unconstructed in general, by the execution language. As a result, the destructor object will not be called when the object goes out of scope.
This means that if your constructor had the following code:
int *p1 = new int;
int *p2 = new int;
and the code in this destructor:
delete p1;
delete p2;
p2 - , bad_alloc new.
, p1 .
, , p1.
, , , .
, .
Herb Sutter: ++