[#BloombergLP-bslalg-ArrayDestructionPrimitives-destroy-0d]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bslalg.adoc[bslalg]::xref:BloombergLP/bslalg/ArrayDestructionPrimitives.adoc[ArrayDestructionPrimitives]::destroy
:relfileprefix: ../../../
:mrdocs:

`destroy` overloads

== Synopses

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

Destroy of the elements in the segment of an array of parameterized `TARGET&lowbar;TYPE` beginning at the specified `begin` address and ending immediately before the specified `end` address&period; If `begin &equals;&equals; 0` and `end &equals;&equals; 0` this function has no effect&period; The behavior is undefined unless either (1) `begin &lt;&equals; end`, `begin !&equals; 0`, and `end !&equals; 0`, or (2) `begin &equals;&equals; 0 &amp;&amp; end &equals;&equals; 0`&period; Note that this method does not deallocate any memory (except memory deallocated by the element destructor calls)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-04.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-04.adoc[_» more&period;&period;&period;_]#

Destroy each `TARGET&lowbar;TYPE` in `&lsqb;begin, end)&rsqb;` using the destructor&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0e.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end,
    xref:bsl/false_type.adoc[bsl::false&lowbar;type]);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0e.adoc[_» more&period;&period;&period;_]#

Destroy each instance of `TARGET&lowbar;TYPE` in the array beginning at the specified `begin` address and ending immediately before the specified `end` address&period; Elide the use of the destructor entirely if (template parameter) `TARGET&lowbar;TYPE` is bitwise copyable, i&period;e&period; in the overload where the last argument (used only for overload resolution) if of type `bsl&colon;&colon;true&lowbar;type`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class TARGET&lowbar;TYPE&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-02.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end,
    xref:bsl/true_type.adoc[bsl::true&lowbar;type]);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-02.adoc[_» more&period;&period;&period;_]#

Destroy the elements in the segment of an array of parameterized `TARGET&lowbar;TYPE` beginning at the specified `begin` address and ending immediately before the specified `end` address, using the specified `allocator`&period; If `begin &equals;&equals; 0` and `end &equals;&equals; 0` this function has no effect&period; The behavior is undefined unless either (1) `begin &lt;&equals; end`, `begin !&equals; 0`, and `end !&equals; 0`, or (2) `begin &equals;&equals; 0 &amp;&amp; end &equals;&equals; 0`&period; Note that this method does not deallocate any memory (except memory deallocated by the element destructor calls)&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TARGET&lowbar;TYPE,
    class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0a.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end,
    ALLOCATOR allocator);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0a.adoc[_» more&period;&period;&period;_]#

Same as the preceding `destroy` overload, for non&hyphen;bitwise&hyphen;copyable types&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TARGET&lowbar;TYPE,
    class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-09.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end,
    ALLOCATOR allocator,
    xref:bsl/false_type.adoc[bsl::false&lowbar;type]);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-09.adoc[_» more&period;&period;&period;_]#

Destroy each instance of `TARGET&lowbar;TYPE` in the array beginning at the specified `begin` address and ending immediately before the specified `end` address, using the specified `allocator`&period; Elide the use of the destructor entirely if (template parameter) `TARGET&lowbar;TYPE` is bitwise copyable, i&period;e&period;, in the overload where the last argument (used only for overload resolution) is of type `bsl&colon;&colon;true&lowbar;type`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;
    class TARGET&lowbar;TYPE,
    class ALLOCATOR&gt;
static
void
xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0b.adoc[destroy](
    TARGET&lowbar;TYPE* begin,
    TARGET&lowbar;TYPE* end,
    ALLOCATOR allocator,
    xref:bsl/true_type.adoc[bsl::true&lowbar;type]);
----

[.small]#xref:BloombergLP/bslalg/ArrayDestructionPrimitives/destroy-0b.adoc[_» more&period;&period;&period;_]#


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