[#BloombergLP-bsls-AssertFailureHandlerGuard]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bsls.adoc[bsls]::AssertFailureHandlerGuard
:relfileprefix: ../../
:mrdocs:

Guard that temporarily replaces the assertion&hyphen;failure handler&period;

== Synopsis

Declared in `&lt;bsls&lowbar;assert&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class AssertFailureHandlerGuard;
----

== Description

An object of this class saves the current assert handler and installs the one specified on construction&period; On destruction, the original assert handler is restored&period; Note that two objects of this class cannot be safely used concurrently from two separate threads (but may of course appear sequentially, including in nested blocks and function invocations within a single thread)&period; Note that the behavior of objects of this class is unaffected by the (`static`) `Assert&colon;&colon;lockAssertAdministration` method (i&period;e&period;, the temporary replacement will occur, regardless of whether that method has been invoked&period;)

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bsls/AssertFailureHandlerGuard/2constructor-09.adoc[`AssertFailureHandlerGuard`]         [.small]#[constructor]#
| Constructors
| xref:BloombergLP/bsls/AssertFailureHandlerGuard/2destructor.adoc[`&#126;AssertFailureHandlerGuard`] [.small]#[destructor]#
| Restore the failure handler that was in place when this object was created and destroy this guard&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
