r/ProgrammerHumor • • 14d ago

Meme cppAndItsVectorBooleans

Post image
3.4k Upvotes

214 comments sorted by

View all comments

Show parent comment

-5

u/nimrag_is_coming 13d ago

Sort of, the compiler is allowed to pack sequential book fields in classes into single bytes

10

u/unknown_alt_acc 13d ago

The compiler is absolutely not allowed to pack contiguous bools. That breaks the addressability requirement of objects. If you want packed Boolean values, the language gives you plenty of ways to express that.