[#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`. == Synopsis Declared in `<bdlc_queue.h>` [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`. The behavior is undefined unless `0 <= dstIndex < length()`. Note that this function is logically equivalent to (but more efficient than): ` insert(dstIndex, item); remove(dstIndex + 1); ` == Parameters [cols="1,4"] |=== | Name| Description | *dstIndex* | index of the element to replace | *item* | replacement value |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#