BloombergLP::bdlc::CompactedArray::insert

Insert elements from srcArray into this array at dstIndex.

Synopsis

Declared in <bdlc_compactedarray.h>

void
insert(
    std::size_t dstIndex,
    CompactedArray const& srcArray,
    std::size_t srcIndex,
    std::size_t numElements);

Description

Insert into this array, at the specified dstIndex, the specified numElements starting at the specified srcIndex in the specified srcArray. Elements having an index greater than or equal to dstIndex before the insertion are shifted up by numElements index positions. The behavior is undefined unless dstIndex <= length() and srcIndex + numElements <= srcArray.length(). Note that if this array and srcArray are the same, the behavior is as if a copy of srcArray were passed.

Parameters

NameDescription
dstIndexindex at which to insert
srcArrayarray providing values to insert
srcIndexfirst index in srcArray to copy from
numElementsnumber of elements to insert