I have this code:
void removeControlChar(std::string* str)
{
std::string::iterator begin = str->begin();
std::string::iterator end = str->end();
str->erase(std::remove_if(begin, end, invalidChar));
}
bool invalidChar(char c)
{
return !(c >= 33 && c < 128);
}
When I compile it with MSVC 2017 it works but it segfault with Clang and GCC. What's wrong with it ?
Aucun commentaire:
Enregistrer un commentaire