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

This class implements a range proctor that destroys managed objects&period;

== Synopsis

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

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

== Description

This class implements a range proctor that, unless its `release` method has previously been invoked, automatically destroys the contiguous sequence of managed objects upon its own destruction by invoking each object&apos;s destructor&period; If `release` is invoked (see `release`), the proctor will not destroy any objects upon its own destruction (unless `reset` is invoked to assign the proctor another contiguous sequence of objects for management)&period; Note that when the length of this object is non&hyphen;zero, it must refer to a non&hyphen;null array of objects&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslma/AutoDestructor/2constructor.adoc[`AutoDestructor`]         [.small]#[constructor]#
| Create a range proctor to manage an array of objects&period;
| xref:BloombergLP/bslma/AutoDestructor/2destructor.adoc[`&#126;AutoDestructor`] [.small]#[destructor]#
| Destroy this range proctor and the objects it manages&period;
| xref:BloombergLP/bslma/AutoDestructor/length.adoc[`length`] 
| Return the (signed) length of the sequence of objects managed by this range proctor&period;
| xref:BloombergLP/bslma/AutoDestructor/operator_inc.adoc[`operator&plus;&plus;`] 
| Increase by one the (signed) length of the managed object sequence&period;
| xref:BloombergLP/bslma/AutoDestructor/operator_dec.adoc[`operator&hyphen;&hyphen;`] 
| Decrease by one the (signed) length of the managed object sequence&period;
| xref:BloombergLP/bslma/AutoDestructor/release.adoc[`release`] 
| Release from management the sequence of objects managed by this proctor&period;
| xref:BloombergLP/bslma/AutoDestructor/reset.adoc[`reset`] 
| Set the origin of the sequence of objects managed by this proctor&period;
| xref:BloombergLP/bslma/AutoDestructor/setLength.adoc[`setLength`] 
| Set the (signed) length of the managed object sequence&period;
|===



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