M
markscottwright
I'm using visual studio 8, and the following code is failing. For the
life of me, I can't see what's wrong...
void myTest(std::string const& in)
{
using namespace std;
string::const_iterator lastNonWhitespace = find_if(in.rbegin(),
in.rend(), not1(ptr_fun(isspace)));
}
The error is:
strutils.cpp|226 error 2440| 'initializing' : cannot convert from
'std::reverse_iterator<_RanIt>' to
'std::_String_const_iterator<_Elem,_Traits,_Alloc>'
|| with
|| [
||
_RanIt=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>
|| ]
|| and
|| [
|| _Elem=char,
|| _Traits=std::char_traits<char>,
|| _Alloc=std::allocator<char>
|| ]
|| No constructor could take the source type, or constructor
overload resolution was ambiguous
life of me, I can't see what's wrong...
void myTest(std::string const& in)
{
using namespace std;
string::const_iterator lastNonWhitespace = find_if(in.rbegin(),
in.rend(), not1(ptr_fun(isspace)));
}
The error is:
strutils.cpp|226 error 2440| 'initializing' : cannot convert from
'std::reverse_iterator<_RanIt>' to
'std::_String_const_iterator<_Elem,_Traits,_Alloc>'
|| with
|| [
||
_RanIt=std::_String_const_iterator<char,std::char_traits<char>,std::allocator<char>>
|| ]
|| and
|| [
|| _Elem=char,
|| _Traits=std::char_traits<char>,
|| _Alloc=std::allocator<char>
|| ]
|| No constructor could take the source type, or constructor
overload resolution was ambiguous