Hacker News new | ask | show | jobs
by kaik 1825 days ago
I kid you not, I spent a full working day debugging this exact same issue (taking a pointer to a vector element, before adding more elements). Very obvious if you understand how C++ and vectors work, yet it took me forever to realize, and it was miserable…
1 comments

Heh, you can run into this even if you understand how iterator invalidation works. Once you see the bug it's easy to understand, but finding it might not be…
> finding it might not be…

Valgrind memcheck is your friend.

also asan.