BloombergLP::bdlb::IndexSpanUtil::shrink

Return an IndexSpan shrunk from the ends of the specified original.

Synopsis

Declared in <bdlb_indexspanutil.h>

static
IndexSpan
shrink(
    IndexSpan const& original,
    IndexSpan::size_type shrinkBegin,
    IndexSpan::size_type shrinkEnd);

Description

The result is transformed using the specified shrinkBegin and shrinkEnd so that its position is original.position() + shrinkBegin and whose length is original.length() - (shrinkBegin + shrinkEnd). The behavior is undefined unless shrinkBegin + shrinkEnd <= original.length().

Return Value

an IndexSpan shrunk from the ends of original

Parameters

NameDescription
originalspan to shrink
shrinkBeginnumber of elements to remove from the start
shrinkEndnumber of elements to remove from the end