[#BloombergLP-bslma-AutoDeallocator] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslma.adoc[bslma]::AutoDeallocator :relfileprefix: ../../ :mrdocs: This class implements a range proctor that automatically deallocates managed memory blocks. == Synopsis Declared in `<bslma_autodeallocator.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> class AutoDeallocator; ---- == Description This class implements a range proctor that, unless its `release` method has previously been invoked, automatically deallocates the contiguous sequence of managed memory blocks upon its own destruction by invoking the `deallocate` method of an allocator (or pool) of parameterized `ALLOCATOR` type supplied to it at construction. Each of the managed memory blocks must have been supplied by this allocator (or pool), which must remain valid throughout the lifetime of the range proctor. Note that when the length of this object is non‐zero, it must refer to a non‐null array of memory blocks. == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bslma/AutoDeallocator/2constructor-080.adoc[`AutoDeallocator`] [.small]#[constructor]# | Create an auto deallocator to manage a sequence of memory blocks. | xref:BloombergLP/bslma/AutoDeallocator/2destructor.adoc[`~AutoDeallocator`] [.small]#[destructor]# | Destroy this range proctor and deallocate any managed memory blocks. | xref:BloombergLP/bslma/AutoDeallocator/length.adoc[`length`] | Return the (signed) length of the sequence of memory blocks managed by this proctor. | xref:BloombergLP/bslma/AutoDeallocator/operator_inc.adoc[`operator++`] | Increase by one the (signed) length of the managed memory‐block sequence. | xref:BloombergLP/bslma/AutoDeallocator/operator_dec.adoc[`operator‐‐`] | Decrease by one the (signed) length of the managed memory‐block sequence. | xref:BloombergLP/bslma/AutoDeallocator/release.adoc[`release`] | Release from management all memory blocks currently managed by this proctor. | xref:BloombergLP/bslma/AutoDeallocator/reset-01.adoc[`reset`] | Set the origin of the sequence of memory blocks managed by this proctor. | xref:BloombergLP/bslma/AutoDeallocator/setLength.adoc[`setLength`] | Set the (signed) length of the managed memory‐block sequence. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#