[#BloombergLP-bdlc-BitArray-insert-0a]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/BitArray.adoc[BitArray]::insert
:relfileprefix: ../../../
:mrdocs:

Insert a bit range from `srcArray` at `dstIndex` in this array&period;

== Synopsis

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

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

== Description

Insert into this array, beginning at the specified `dstIndex`, the specified `numBits` from the specified `srcArray` beginning at the specified `srcIndex`&period; All values with initial indices at or above `dstIndex` are shifted up by `numBits` positions&period; The behavior is undefined unless `dstIndex &lt;&equals; length()` and `srcIndex &plus; numBits &lt;&equals; srcArray&period;length()`&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstIndex*
| index at which to insert
| *srcArray*
| array providing the bits to insert
| *srcIndex*
| starting index in `srcArray`
| *numBits*
| number of bits to insert
|===


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