cm0002@lemmy.world to Programmer Humor@programming.dev · 10 天前Tell me the truth ...piefed.jeena.netimagemessage-square165fedilinkarrow-up11.16Karrow-down117
arrow-up11.14Karrow-down1imageTell me the truth ...piefed.jeena.netcm0002@lemmy.world to Programmer Humor@programming.dev · 10 天前message-square165fedilink
minus-squareborokov@lemmy.worldlinkfedilinkarrow-up2·9 天前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.
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.