[#BloombergLP-bdlc-CompactedArray-replace-0c]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/CompactedArray.adoc[CompactedArray]::replace
:relfileprefix: ../../../
:mrdocs:

`replace` overloads

== Synopses

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

Change the value of the element at the specified `dstIndex` in this array to the specified `value`&period; The behavior is undefined unless `dstIndex &lt; length()`&period;


[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
xref:BloombergLP/bdlc/CompactedArray/replace-08.adoc[replace](
    std::size&lowbar;t dstIndex,
    TYPE const& value);
----

[.small]#xref:BloombergLP/bdlc/CompactedArray/replace-08.adoc[_» more&period;&period;&period;_]#

Replace elements at `dstIndex` with elements from `srcArray`&period;


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

[.small]#xref:BloombergLP/bdlc/CompactedArray/replace-0d.adoc[_» more&period;&period;&period;_]#

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstIndex*
| index of the element to replace
| *value*
| new value for the element
| *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]#
