I'm using g++ 4.7.
What I'm trying to do is this,
find_if(s.begin(), s.end(), isalnum);
where isalnum
is defined in cctype
and s
is a string.
logman.cpp:68:47: error: no matching function for call to ‘find_if(std::basic_string<char>::const_iterator, std::basic_string<char>::const_iterator, <unresolved overloaded function type>)’
However, this works,
bool my_isalnum(int c) {
return isalnum(c);
}
find_if(s.begin(), s.end(), my_isalnum);
How can I get this to work without creating my own function?