[#BloombergLP-bslma-DestructorGuard]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DestructorGuard
:relfileprefix: ../../
:mrdocs:

This class implements a guard that unconditionally destroys a managed object upon destruction by invoking the (managed) object&apos;s destructor&period;

== Synopsis

Declared in `&lt;bslma&lowbar;destructorguard&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TYPE&gt;
class DestructorGuard;
----

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/DestructorGuard/2constructor.adoc[`DestructorGuard`]         [.small]#[constructor]#
| Create a destructor guard that unconditionally manages the specified `object`, and invokes the destructor of `object` upon the destruction of this guard&period; The behavior is undefined unless `object` is non&hyphen;zero&period;
| xref:BloombergLP/bslma/DestructorGuard/2destructor.adoc[`&#126;DestructorGuard`] [.small]#[destructor]#
| Destroy this destructor guard and the object it manages by invoking the destructor of the (managed) object&period;
|===



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