I have a vector that stores pointers to many objects instantiated dynamically, and I\'m trying to iterate through the vector and remove certain elements (remove from vector
Once you modify the vector, all outstanding iterators become invalid. In other words, you can't modify the vector while you are iterating through it. Think about what that does to the memory and you'll see why. I suspect that your assert is an "invalid iterator" assert.
std::vector::erase() returns an iterator that you should use to replace the one you were using. See here.