BloombergLP::bdlb::BitStringUtil::removeAndFill1

Remove bits and fill vacated high-order bits with 1.

Synopsis

Declared in <bdlb_bitstringutil.h>

static
void
removeAndFill1(
    uint64_t* bitString,
    std::size_t length,
    std::size_t index,
    std::size_t numBits);

Description

Remove the specified numBits from the specified bitString having the specified length beginning at the specified index. Bits above index + numBits are shifted down by numBits index positions and the last numBits of bitString are set to 1. The length of bitString is not changed. The behavior is undefined unless index + numBits <= length.

Parameters

NameDescription
bitStringbit string to modify
lengthnumber of bits in bitString
indexstarting bit position of the range to remove
numBitsnumber of bits to remove