[#BloombergLP-bdlc-Queue-replace-0a] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::xref:BloombergLP/bdlc/Queue.adoc[Queue]::replace :relfileprefix: ../../../ :mrdocs: Replace elements at `dstIndex` with elements from `srcQueue`. == Synopsis Declared in `<bdlc_queue.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- void replace( int dstIndex, xref:BloombergLP/bdlc/Queue.adoc[Queue] const& srcQueue, int srcIndex, int numElements); ---- == Description Replace the specified `numElements` values beginning at the specified `dstIndex` in this queue with values from the specified `srcQueue` beginning at the specified `srcIndex`. The behavior is undefined unless `0 <= dstIndex, 0 <= numElements`, `dstIndex + numElements <= length()`, `0 <= srcIndex`, and `srcIndex + numElements <= srcQueue.length()`. Note that this function is logically equivalent to (but more efficient than): ` insert(dstIndex, srcQueue, srcIndex, numElements); remove(dstIndex + numElements, numElements); ` == Parameters [cols="1,4"] |=== | Name| Description | *dstIndex* | first index in this queue to replace | *srcQueue* | queue providing replacement values | *srcIndex* | first index in `srcQueue` to copy from | *numElements* | number of elements to replace |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#