[#BloombergLP-bdlc-Queue-replace-05]
= xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/Queue.adoc[Queue]::replace
:relfileprefix: ../../../
:mrdocs:

Replace the element at `dstIndex` with the specified `item`&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
void
replace(
    int dstIndex,
    T const& item);
----

== Description

Replace the element at the specified `dstIndex` in this queue with the specified `item`&period; The behavior is undefined unless `0 &lt;&equals; dstIndex &lt; length()`&period; Note that this function is logically equivalent to (but more efficient than)&colon; &grave; insert(dstIndex, item)&semi; remove(dstIndex &plus; 1)&semi; &grave;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *dstIndex*
| index of the element to replace
| *item*
| replacement value
|===


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