BloombergLP::bdlb::BitMaskUtil

Namespace for functions that produce 32- and 64-bit bit masks.

Synopsis

Declared in <bdlb_bitmaskutil.h>

struct BitMaskUtil;

Description

This utility struct provides a namespace for a set of bit-level, stateless functions that take one or two int arguments and return masks of the built-in 32- and 64-bit integer types uint32_t and uint64_t, respectively.

Enums

NameDescription
Unnamed enum Number of bits in type uint32_t.

Static Member Functions

NameDescription
eq Return a mask with only the bit at index set.
eq64 Return a mask with only the bit at index set.
ge Return a mask with all bits at or above index set.
ge64 Return a mask with all bits at or above index set.
gt Return a mask with all bits above index set.
gt64 Return a mask with all bits above index set.
le Return a mask with all bits at or below index set.
le64 Return a mask with all bits at or below index set.
lt Return the unsigned integral value having all bits at positions less than the specified index set to 1, and all other bits set to 0.
lt64 Return a mask with all bits below index set.
ne Return a bitmask with the bit at index cleared.
ne64 Return a bitmask with the bit at index cleared.
one Return a mask with numBits bits set starting at index.
one64 Return a mask with numBits bits set starting at index.
zero Return the unsigned integral value having the specified numBits starting at the specified index set to 0, and all other bits set to 1.
zero64 Return a mask with numBits bits cleared starting at index.