cm0002@lemmy.world to Programmer Humor@programming.dev · 9 months agoTell me the truth ...piefed.jeena.netimagemessage-square145linkfedilinkarrow-up11.06Karrow-down114
arrow-up11.05Karrow-down1imageTell me the truth ...piefed.jeena.netcm0002@lemmy.world to Programmer Humor@programming.dev · 9 months agomessage-square145linkfedilink
minus-squareKindaABigDyl@programming.devlinkfedilinkarrow-up168·9 months agotypedef struct { bool a: 1; bool b: 1; bool c: 1; bool d: 1; bool e: 1; bool f: 1; bool g: 1; bool h: 1; } __attribute__((__packed__)) not_if_you_have_enough_booleans_t;
minus-squarexthexder@l.sw0.comlinkfedilinkarrow-up34·9 months agoOr just std::bitset<8> for C++. Bit fields are neat though, it can store weird stuff like a 3 bit integer, packed next to booleans
You beat me to it!
Or just
std::bitset<8>for C++. Bit fields are neat though, it can store weird stuff like a 3 bit integer, packed next to booleans