This utility struct provides a namespace for a set of bit‐level, stateless functions that operate on the built‐in 32‐ and 64‐bit unsigned integer types.

Synopsis

Declared in <bdlb_bitutil.h>

struct BitUtil;

Type Aliases

Name

Description

uint32_t

Alias for bsl::uint32_t provided for older toolchains.

uint64_t

Alias for bsl::uint64_t provided for older toolchains.

Static Member Functions

Name

Description

isBitSet

isBitSet overloads

log2

log2 overloads

numBitsSet

numBitsSet overloads

numLeadingUnsetBits

numLeadingUnsetBits overloads

numTrailingUnsetBits

numTrailingUnsetBits overloads

roundUp

roundUp overloads

roundUpToBinaryPower

roundUpToBinaryPower overloads

sizeInBits

Return the number of bits in the specified value of the (template parameter) type INTEGER.

withBitCleared

withBitCleared overloads

withBitSet

withBitSet overloads

Created with MrDocs