Packed structs in Zig make bit/flag sets trivial
devlog.hexops.com
devlog.hexops.com
>In practice, everything you’re likely to come across will be little endian nowadays, and the ABI you’re using will most likely order your struct from top to bottom in memory, so they will look the same most of the time.
Unfortunately it is not that simple:
https://github.com/mahkoh/repr-c/blob/0c218ac5a6f82034e649fe...
Because an unsigned integer containing many flags is convenient for setting/toggling/clearing multiple options at once. At least in C doing that with bit fields is a pain.