[#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. == Synopsis Declared in `<bslma_autodestructor.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TYPE> 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's destructor. 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). Note that when the length of this object is non‐zero, it must refer to a non‐null array of objects. == 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. | xref:BloombergLP/bslma/AutoDestructor/2destructor.adoc[`~AutoDestructor`] [.small]#[destructor]# | Destroy this range proctor and the objects it manages. | xref:BloombergLP/bslma/AutoDestructor/length.adoc[`length`] | Return the (signed) length of the sequence of objects managed by this range proctor. | xref:BloombergLP/bslma/AutoDestructor/operator_inc.adoc[`operator++`] | Increase by one the (signed) length of the managed object sequence. | xref:BloombergLP/bslma/AutoDestructor/operator_dec.adoc[`operator‐‐`] | Decrease by one the (signed) length of the managed object sequence. | xref:BloombergLP/bslma/AutoDestructor/release.adoc[`release`] | Release from management the sequence of objects managed by this proctor. | xref:BloombergLP/bslma/AutoDestructor/reset.adoc[`reset`] | Set the origin of the sequence of objects managed by this proctor. | xref:BloombergLP/bslma/AutoDestructor/setLength.adoc[`setLength`] | Set the (signed) length of the managed object sequence. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#