Hello All,
I'm getting an error in g++ when I try and compile a cpp file using transform...
Here's the error...
customer.cpp:42 9: error: no matching function for call to transform(__gnu _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> > >, __gnu_cxx::__no rmal_iterator<c har*, std::basic_stri ng<char, std::char_trait s<char>, std::allocator< char> > >, <unresolved overloaded function type>)
The code in question is the following. #include <algorithm> is present and the code compiles no problem under Visual Studio. I know strictly speaking strings aren't containers but shouldn't this work or do you have to do something different for g++. Did MS include an overload that isn't in g++ ??
Here's a comment on the problem though I can't get to the FAQ mentioned...
g++ Thread on bug
John
I'm getting an error in g++ when I try and compile a cpp file using transform...
Here's the error...
customer.cpp:42 9: error: no matching function for call to transform(__gnu _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> > >, __gnu_cxx::__no rmal_iterator<c har*, std::basic_stri ng<char, std::char_trait s<char>, std::allocator< char> > >, <unresolved overloaded function type>)
The code in question is the following. #include <algorithm> is present and the code compiles no problem under Visual Studio. I know strictly speaking strings aren't containers but shouldn't this work or do you have to do something different for g++. Did MS include an overload that isn't in g++ ??
Code:
void gen_id( customer& c )
{
string temp;
temp = c.last_name;
temp += c.first_name.at(0);
transform( temp.begin(), temp.end(), temp.begin(), toupper);
temp += c.date->get( YEAR );
c.account = temp;
}
g++ Thread on bug
John
Comment