[#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 the elements in the specified array range&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] traits);
----

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

Destroy each `TARGET&lowbar;TYPE` in `&lsqb;begin, end)&rsqb;`&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] traits);
----

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

Destroy the elements in the specified array range using an allocator&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] traits);
----

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

Destroy each `TARGET&lowbar;TYPE` in `&lsqb;begin, end)&rsqb;` using an allocator&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] traits);
----

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *begin*
| beginning of the range of elements to destroy
| *end*
| end of the range of elements to destroy (one past the last)
| *traits*
| unused trait tag for overload resolution
| *allocator*
| allocator used to destroy elements
|===


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