[#BloombergLP-bdlc-BitArray-assign-07] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/BitArray.adoc[BitArray]::assign :relfileprefix: ../../../ :mrdocs: Replace a bit range in this array with bits from `srcArray`. == Synopsis Declared in `<bdlc_bitarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void assign( std::size_t dstIndex, xref:BloombergLP/bdlc/BitArray.adoc[BitArray] const& srcArray, std::size_t srcIndex, std::size_t numBits); ---- == Description Replace the specified `numBits` in this array, beginning at the specified `dstIndex`, with values from the specified `srcArray` beginning at the specified `srcIndex`. The behavior is undefined unless `dstIndex + numBits <= length()` and `srcIndex + numBits <= srcArray.length()`. Note that, absent aliasing, this method has the same behavior as, but is more efficient than: ` remove(dstIndex, numBits); insert(dstIndex, srcArray, srcIndex, numBits); ` == Parameters [cols="1,4"] |=== | Name| Description | *dstIndex* | starting index in this array | *srcArray* | array providing the replacement bits | *srcIndex* | starting index in `srcArray` | *numBits* | number of bits to replace |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#