Just in case you wonder, this would be a proper way:
std::vector<sf::VideoMode>::iterator it = relist.begin();
while(it != relist.end())
{
if(!it->isValid())
it = relist.erase(it);
else
++it;
}
Since erase removes the current element, the iterator points at the next one. That's why you only have to increase it when nothing gets removed, or else you'd skip elements.