[#BloombergLP-bslalg-AutoScalarDestructor]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::AutoScalarDestructor
:relfileprefix: ../../
:mrdocs:

Proctor that destroys a guarded object unless released&period;

== Synopsis

Declared in `&lt;bslalg&lowbar;autoscalardestructor&period;h&gt;`

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

== Description

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&lowbar;TYPE`&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/AutoScalarDestructor/2constructor.adoc[`AutoScalarDestructor`]         [.small]#[constructor]#
| Create a guard that destroys the specified object unless released&period;
| xref:BloombergLP/bslalg/AutoScalarDestructor/2destructor.adoc[`&#126;AutoScalarDestructor`] [.small]#[destructor]#
| Call the destructor on the object of the parameterized `OBJECT&lowbar;TYPE` that is proctored by this guard object, if any, and destroy this object&period;
| 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&period;
| 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&period;
|===



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