[#BloombergLP-bslma-DestructorProctor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::DestructorProctor :relfileprefix: ../../ :mrdocs: This class implements a proctor that, unless its `release` method has previously been invoked, automatically destroys a managed object upon destruction by invoking the (managed) object's destructor. == Synopsis Declared in `<bslma_destructorproctor.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> class DestructorProctor; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/DestructorProctor/2constructor.adoc[`DestructorProctor`] [.small]#[constructor]# | Create a destructor proctor that conditionally manages the specified `object` (if non‐zero) by invoking the destructor of the object managed by this proctor (if not released ‐‐ see `release`) upon destruction. | xref:BloombergLP/bslma/DestructorProctor/2destructor.adoc[`~DestructorProctor`] [.small]#[destructor]# | Destroy this destructor proctor, and destroy the object it manages (if any) by invoking the destructor of the (managed) object. If no object is currently being managed, this method has no effect. | xref:BloombergLP/bslma/DestructorProctor/release.adoc[`release`] | Release from management the object currently managed by this proctor. If no object is currently being managed, this method has no effect. | xref:BloombergLP/bslma/DestructorProctor/reset.adoc[`reset`] | Set the specified `object` as the object to be managed by this proctor. The behavior is undefined unless `object` is non‐zero. Note that this method releases any previously‐managed object from management (without destroying it), and so may be invoked with or without having called `release` when reusing this object. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#