minus-squareborokov@lemmy.worldtoProgrammer Humor@programming.dev•Tell me the truth ...linkfedilinkarrow-up2·9 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. linkfedilink
minus-squareborokov@lemmy.worldtoProgrammer Humor@programming.dev•Tell me the truth ...linkfedilinkarrow-up3arrow-down1·10 days agoPeasant… https://github.com/aumuell/open-inventor/blob/014e2bf17f50f5d510cdd57744d03c436ee9ce27/lib/database/include/Inventor/SbBasic.h#L83 linkfedilink
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.