[#BloombergLP-bslalg-AutoScalarDestructor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::AutoScalarDestructor :relfileprefix: ../../ :mrdocs: This `class` provides a specialized proctor object that, upon destruction and unless the `release` method is called, destroys the guarded object of the parameterized `OBJECT_TYPE`. == Synopsis Declared in `<bslalg_autoscalardestructor.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class OBJECT_TYPE> class AutoScalarDestructor; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/AutoScalarDestructor/2constructor.adoc[`AutoScalarDestructor`] [.small]#[constructor]# | Create a guard object, proctoring the specified `object` of the parameterized `OBJECT_TYPE` (if non‐zero), that will invoke the destructor of `object` upon destruction. | xref:BloombergLP/bslalg/AutoScalarDestructor/2destructor.adoc[`~AutoScalarDestructor`] [.small]#[destructor]# | Call the destructor on the object of the parameterized `OBJECT_TYPE` that is proctored by this guard object, if any, and destroy this object. | xref:BloombergLP/bslalg/AutoScalarDestructor/release.adoc[`release`] | Set the address of the object proctored by this guard object to 0, thereby releasing from management the object currently managed by this proctor, if any. | xref:BloombergLP/bslalg/AutoScalarDestructor/reset.adoc[`reset`] | Set this guard object to manage the specified `object`, thereby releasing from management any object currently managed by this proctor, if any. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#