[#BloombergLP-bdlc-CompactedArray-replace-0d] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/CompactedArray.adoc[CompactedArray]::replace :relfileprefix: ../../../ :mrdocs: Replace elements at `dstIndex` with elements from `srcArray`. == Synopsis Declared in `<bdlc_compactedarray.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void replace( std::size_t dstIndex, xref:BloombergLP/bdlc/CompactedArray.adoc[CompactedArray] const& srcArray, std::size_t srcIndex, std::size_t numElements); ---- == Description Change the values of the specified `numElements` starting at the specified `dstIndex` in this array to those of the `numElements` starting at the specified `srcIndex` in the specified `srcArray`. The behavior is undefined unless `srcIndex + numElements <= srcArray.length()` and `dstIndex + numElements <= length()`. Note that if this array and `srcArray` are the same, the behavior is as if a copy of `srcArray` were passed. == Parameters [cols="1,4"] |=== | Name| Description | *dstIndex* | first index in this array to replace | *srcArray* | array providing replacement values | *srcIndex* | first index in `srcArray` to copy from | *numElements* | number of elements to replace |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#