cm0002@lemmy.world to Programmer Humor@programming.dev · 16 days agoTell me the truth ...piefed.jeena.netimagemessage-square149linkfedilinkarrow-up11.17K
arrow-up11.17KimageTell me the truth ...piefed.jeena.netcm0002@lemmy.world to Programmer Humor@programming.dev · 16 days agomessage-square149linkfedilink
minus-squareborokov@lemmy.worldlinkfedilinkarrow-up2·14 days agoauto v = std::vector<bool>(8); bool* vPtr = v.data; vPtr[2] = true; // KABOOM !!! I’ve spent days tracking this bug… That’s how I learned about bool specialisation of std::vector.
auto v = std::vector<bool>(8); bool* vPtr = v.data; vPtr[2] = true; // KABOOM !!!
I’ve spent days tracking this bug… That’s how I learned about bool specialisation of std::vector.