1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
5 <title>Exception Guarantee Specifics
</title>
7 <body bgcolor =
"white">
8 <h1>Exception Guarantee Specifics
</h1>
9 The following represent exception guaratee specifics, subject to the
<a href=
"component_requirements.html#exception_requirements">component exception-requirements
</a>.
11 <li> <a name=
"basic_guarantee">No
</a> resources are leaked in the face of exceptions. In particular, this means:
13 <li>By the time a container's destructor completes:
15 <li>It has returned all memory it has allocated to the appropriate deallocation function.
</li>
16 <li>The destructor has been called for all objects constructed by the container.
</li>
18 <li>Algorithms destroy all temporary objects and deallocate all temporary memory even if the algorithm does not complete due to an exception.
</li>
19 <li>Algorithms which construct objects either complete successfully or destroy any objects they have constructed at the time of the exception.
</li>
20 <li>Algorithms which destruct objects always succeed.
</li>
21 <li>Containers continue to fulfill all of their requirements, even after an exception occurs during a mutating function. For example, they will never give an inaccurate report of its size, or fail to meet performance requirements because of some thrown exception.
</li>
24 <li> <a name=
"strong_guarantee">The
</a> <i>strong guarantee
</i>: If an operation on a container fails due to an exception, then, semantically, the operation is a no-op applied to the container.
</li>
25 <li> <a name=
"cannot_throw_guarantee">The
</a> operation cannot throw an exception.
</li>
27 (The phrasing of the above is based on
<a href=
"references.html#abrahams97exception">[abrahams97exception]
</a>.)