[#BloombergLP-bslalg-ArrayPrimitives-erase-00] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayPrimitives.adoc[ArrayPrimitives]::erase :relfileprefix: ../../../ :mrdocs: `erase` overloads == Synopses Declared in `<bslalg_arrayprimitives.h>` TBD: improve comment Destroy the elements of type given by the `allocator_traits` class template for (template parameter) `ALLOCATOR` starting at the specified `first` `first` pointer and ending immediately before the specified `middle` pointer, and move the elements in the array starting at `middle` and ending at the specified `last` pointer down to the `first` pointer. If an assignment throws an exception during this process, all of the elements in the range `[ first, last )]` will have unspecified but valid values, and no elements are destroyed. The behavior is undefined unless `first <= middle <= last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class ALLOCATOR> static void xref:BloombergLP/bslalg/ArrayPrimitives/erase-0d.adoc[erase]( bsl::allocator_traits<ALLOCATOR>::pointer first, bsl::allocator_traits<ALLOCATOR>::pointer middle, bsl::allocator_traits<ALLOCATOR>::pointer last, ALLOCATOR allocator); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/erase-0d.adoc[_» more..._]# Destroy the elements of the parameterized `TARGET_TYPE` in the array starting at the specified `first` address and ending immediately before the specified `middle` address, and move the elements in the array starting at `middle` and ending at the specified `last` address down to the `first` address. If an assignment throws an exception during this process, all of the elements in the range `[ first, last )]` will have unspecified but valid values, and no elements are destroyed. The behavior is undefined unless `first <= middle <= last`. [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<class TARGET_TYPE> static void xref:BloombergLP/bslalg/ArrayPrimitives/erase-05.adoc[erase]( TARGET_TYPE* first, TARGET_TYPE* middle, TARGET_TYPE* last, xref:BloombergLP/bslma/Allocator.adoc[bslma::Allocator]* allocator = 0); ---- [.small]#xref:BloombergLP/bslalg/ArrayPrimitives/erase-05.adoc[_» more..._]# [.small]#Created with https://www.mrdocs.com[MrDocs]#