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() )].
Declared in <bslalg_autoarraydestructor.h>
template<
class OBJECT_TYPE,
class ALLOCATOR = bsl::allocator<OBJECT_TYPE>>
class AutoArrayDestructor;
| Name | Description |
|---|---|
difference_type | Standard signed difference type used by pointer arithmetic. |
| Name | Description |
|---|---|
AutoArrayDestructor [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. |
~AutoArrayDestructor [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. |
moveBegin | Move the begin pointer by the specified offset, and return the new begin pointer. |
moveEnd | Move the end pointer by the specified offset, and return the new end pointer. |
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. |