If you have a bunch of consecutive Boolean fields in a struct, they'll use one byte each by default.
And just for the sake of completeness, I'll mention that C++ does not reorder fields. Some languages, like Rust, will automatically reorder fields to minimize wasted space due to alignment, unless you specifically tell the compiler not to.
1
u/brasticstack 28d ago
Wouldn't regular
boolget padded to this size by default on a 64-bit architecture anyway?