BloombergLP::bdlb::BitStringUtil::areEqual

Return whether corresponding bit ranges of two bit strings are equal.

Synopsis

Declared in <bdlb_bitstringutil.h>

static
bool
areEqual(
    uint64_t const* bitString1,
    std::size_t index1,
    uint64_t const* bitString2,
    std::size_t index2,
    std::size_t numBits);

Description

Return true if the specified numBits beginning at the specified index1 in the specified bitString1 are bitwise equal to the numBits beginning at the specified index2 in the specified bitString2, and false otherwise. The behavior is undefined unless bitString1 has a length of at least index1 + numBits and bitString2 has a length of at least index2 + numBits.

Return Value

true if the compared bits are equal, and false otherwise

Parameters

NameDescription
bitString1first bit string
index1starting bit index in bitString1
bitString2second bit string
index2starting bit index in bitString2
numBitsnumber of bits to compare