[#BloombergLP-bdlb-BitStringUtil-insert]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlb.adoc[bdlb]::xref:BloombergLP/bdlb/BitStringUtil.adoc[BitStringUtil]::insert
:relfileprefix: ../../../
:mrdocs:

Insert the specified `numBits`, each having the specified `value`, into the specified `bitString` having the specified `initialLength`, beginning at the specified `dstIndex`&period; Bits at or above `dstIndex` are shifted up by `numBits` index positions and the length of `bitString` is increased by `numBits`&period; The behavior is undefined unless `dstIndex &lt;&equals; initialLength` and `bitString` has a capacity of at least `initialLength &plus; numBits`&period;

== Synopsis

Declared in `&lt;bdlb&lowbar;bitstringutil&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
static
void
insert(
    uint64&lowbar;t* bitString,
    std::size&lowbar;t initialLength,
    std::size&lowbar;t dstIndex,
    bool value,
    std::size&lowbar;t numBits);
----


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