Month: November 2018
-
That moment when you need to look up definition of C++ for loop
I was getting a segfault on an old piece of code which I maintain. The culprit was pinpointed to this: bool found = false; vector<string> :: iterator i; for (i = v.begin(); !found && i != v.end(); ++i) { if (name == *i) { found = true; } } if (found) { v.erase( i );…