T
Tashfeen Bhimdi
I'm trying to remove punctuation from a string with the following
code:
----------------------------
#include <string>
#include <algorithm>
#include <cctype>
..
using namespace std
..
..
..
string temp = "blah?yo!";
temp.erase(remove_if(temp.begin(), temp.end(), ispunct), temp.end());
----------------------------
But I keep getting the following compilation error:
"error: no matching function for call to
`remove_if(__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, <unknown type>)'"
Any idea what's wrong?
code:
----------------------------
#include <string>
#include <algorithm>
#include <cctype>
..
using namespace std
..
..
..
string temp = "blah?yo!";
temp.erase(remove_if(temp.begin(), temp.end(), ispunct), temp.end());
----------------------------
But I keep getting the following compilation error:
"error: no matching function for call to
`remove_if(__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >,
__gnu_cxx::__normal_iterator<char*, std::basic_string<char,
std::char_traits<char>, std::allocator<char> > >, <unknown type>)'"
Any idea what's wrong?