[#BloombergLP-bdlc-PackedIntArray-0b-insert-0ae]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/PackedIntArray-0b.adoc[PackedIntArray]::insert
:relfileprefix: ../../../
:mrdocs:

`insert` overloads

== Synopses

Declared in `&lt;bdlc&lowbar;packedintarray&period;h&gt;`

Insert `value` at `dst` and return an iterator to it&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:BloombergLP/bdlc/PackedIntArray-0b/const_iterator.adoc[PackedIntArray&lt;TYPE&gt;::const&lowbar;iterator]
xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0ba.adoc[insert](
    xref:BloombergLP/bdlc/PackedIntArray-0b/const_iterator.adoc[const&lowbar;iterator] dst,
    TYPE value);
----

[.small]#xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0ba.adoc[_» more&period;&period;&period;_]#

Insert `value` at `dstIndex`, shifting later elements up by one&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0bb.adoc[insert](
    std::size&lowbar;t dstIndex,
    TYPE value);
----

[.small]#xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0bb.adoc[_» more&period;&period;&period;_]#

Insert all elements of `srcArray` at `dstIndex`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0a0.adoc[insert](
    std::size&lowbar;t dstIndex,
    xref:BloombergLP/bdlc/PackedIntArray-0b.adoc[PackedIntArray] const& srcArray);
----

[.small]#xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0a0.adoc[_» more&period;&period;&period;_]#

Insert `numElements` from `srcArray` at `dstIndex`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0e.adoc[insert](
    std::size&lowbar;t dstIndex,
    xref:BloombergLP/bdlc/PackedIntArray-0b.adoc[PackedIntArray] const& srcArray,
    std::size&lowbar;t srcIndex,
    std::size&lowbar;t numElements);
----

[.small]#xref:BloombergLP/bdlc/PackedIntArray-0b/insert-0e.adoc[_» more&period;&period;&period;_]#

== Return Value

iterator to the newly inserted element

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dst*
| iterator position at which to insert
| *value*
| element value to insert
| *dstIndex*
| index at which to insert
| *srcArray*
| source array whose elements are inserted
| *srcIndex*
| first index in `srcArray` to insert
| *numElements*
| number of elements to insert
|===


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