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(remo ve_if(temp.begi n(), temp.end(), ispunct), temp.end());
----------------------------
But I keep getting the following compilation error:
"error: no matching function for call to
`remove_if(__gn u_cxx::__normal _iterator<char* , std::basic_stri ng<char,
std::char_trait s<char>, std::allocator< char >,
__gnu_cxx::__no rmal_iterator<c har*, std::basic_stri ng<char,
std::char_trait s<char>, std::allocator< char >, <unknown type>)'"
Any idea what's wrong?
--
Tashfeen Bhimdi
code:
----------------------------
#include <string>
#include <algorithm>
#include <cctype>
..
using namespace std
..
..
..
string temp = "blah?yo!";
temp.erase(remo ve_if(temp.begi n(), temp.end(), ispunct), temp.end());
----------------------------
But I keep getting the following compilation error:
"error: no matching function for call to
`remove_if(__gn u_cxx::__normal _iterator<char* , std::basic_stri ng<char,
std::char_trait s<char>, std::allocator< char >,
__gnu_cxx::__no rmal_iterator<c har*, std::basic_stri ng<char,
std::char_trait s<char>, std::allocator< char >, <unknown type>)'"
Any idea what's wrong?
--
Tashfeen Bhimdi
Comment