[#BloombergLP-bslalg-AutoArrayDestructor] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::AutoArrayDestructor :relfileprefix: ../../ :mrdocs: 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_TYPE`. The elements destroyed are delimited by the "guarded" range `[ begin(), end() )]`. == Synopsis Declared in `<bslalg_autoarraydestructor.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class OBJECT_TYPE, class ALLOCATOR = xref:bsl/allocator-0df.adoc[bsl::allocator<OBJECT_TYPE>]> class AutoArrayDestructor; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/AutoArrayDestructor/difference_type.adoc[`difference_type`] | Standard signed difference type used by pointer arithmetic. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslalg/AutoArrayDestructor/2constructor.adoc[`AutoArrayDestructor`] [.small]#[constructor]# | Create an array exception guard object for the sequence of elements of the parameterized `OBJECT_TYPE` delimited by the range specified by `[ begin, end )]`. The behavior is undefined unless `begin <= end` and each element in the range `[ begin, end )]` has been initialized. | xref:BloombergLP/bslalg/AutoArrayDestructor/2destructor.adoc[`~AutoArrayDestructor`] [.small]#[destructor]# | Call the destructor on each of the elements of the parameterized `OBJECT_TYPE` delimited by the range `[ begin(), end() )]` and destroy this array exception guard. | xref:BloombergLP/bslalg/AutoArrayDestructor/moveBegin.adoc[`moveBegin`] | Move the begin pointer by the specified `offset`, and return the new begin pointer. | xref:BloombergLP/bslalg/AutoArrayDestructor/moveEnd.adoc[`moveEnd`] | Move the end pointer by the specified `offset`, and return the new end pointer. | xref:BloombergLP/bslalg/AutoArrayDestructor/release.adoc[`release`] | Set the range of elements guarded by this object to be empty. Note that `begin() == end()` following this operation, but the specific value is unspecified. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#