• borokov@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    5 days ago
    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.