Just asking why I'm not able to delete an interator as the beginning of the string to the end
I tried to do this:
The first called to the erase method work finely but not the second, why ?
int main()
{
std :: string str{" Supprimer les espaces a la fin et au debut "};
std :: string :: const_iterator itStart{ std :: find_if_not(std :: cbegin(str), std :: cend(str), isspace) };
std :: string :: const_reverse_iterator itEnd{ std :: find_if_not(std :: crbegin(str), std :: crend(str), isspace) };
std :: cout << *itStart << std :: endl;
std :: cout << *itEnd << std :: endl;
str.erase(std :: cbegin(str), itStart);
str.erase(itEnd, std :: end(str));
std :: cout << str << "|" << std :: endl;
return 0;
}