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

This class provides a proctor that destroys a guarded range of array elements&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class OBJECT&lowbar;TYPE,
    class ALLOCATOR = xref:bsl/allocator-0df.adoc[bsl::allocator&lt;OBJECT&lowbar;TYPE&gt;]&gt;
class AutoArrayDestructor;
----

== Description

This `class` provides a specialized proctor object that, upon destruction and unless the `release` method has been called, destroys the elements in a segment of an array of parameterized type `OBJECT&lowbar;TYPE`&period; The elements destroyed are delimited by the &quot;guarded&quot; range `&lsqb; begin(), end() )&rsqb;`&period;

== Type Aliases

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/AutoArrayDestructor/difference_type.adoc[`difference&lowbar;type`] 
| Standard signed difference type used by pointer arithmetic&period;
|===


== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:BloombergLP/bslalg/AutoArrayDestructor/2constructor.adoc[`AutoArrayDestructor`]         [.small]#[constructor]#
| Create a proctor for the specified range of array elements&period;
| xref:BloombergLP/bslalg/AutoArrayDestructor/2destructor.adoc[`&#126;AutoArrayDestructor`] [.small]#[destructor]#
| Call the destructor on each of the elements of the parameterized `OBJECT&lowbar;TYPE` delimited by the range `&lsqb; begin(), end() )&rsqb;` and destroy this array exception guard&period;
| xref:BloombergLP/bslalg/AutoArrayDestructor/moveBegin.adoc[`moveBegin`] 
| Move the begin pointer by the specified `offset`, and return the new begin pointer&period;
| xref:BloombergLP/bslalg/AutoArrayDestructor/moveEnd.adoc[`moveEnd`] 
| Move the end pointer by the specified `offset`, and return the new end pointer&period;
| xref:BloombergLP/bslalg/AutoArrayDestructor/release.adoc[`release`] 
| Set the range of elements guarded by this object to be empty&period; Note that `begin() &equals;&equals; end()` following this operation, but the specific value is unspecified&period;
|===



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