[#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's destructor. == Synopsis Declared in `<bslma_destructorguard.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> 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. The behavior is undefined unless `object` is non‐zero. | xref:BloombergLP/bslma/DestructorGuard/2destructor.adoc[`~DestructorGuard`] [.small]#[destructor]# | Destroy this destructor guard and the object it manages by invoking the destructor of the (managed) object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#