Bit Fields

Bit fields reduce memory footprint by eliminating arrays of booleans or structs of flags. Bit fields allow checking multiple states at once with one AND operation against a combined mask. Each flag in a bit field occupies one bit position.…

1 sources - 5 claims

Bit fields reduce memory footprint by eliminating arrays of booleans or structs of flags. Bit fields allow checking multiple states at once with one AND operation against a combined mask. Each flag in a bit field occupies one bit position. Bit fields use masking operations to set, clear, and test individual flags. Multiple boolean or small-integer states can be packed into one integer using bit fields.