I'm getting an error in g++ when I try and compile a cpp file using transform...
Here's the error...
customer.cpp:429: error: no matching function for call to transform(__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> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<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++ ??
Expand|Select|Wrap|Line Numbers
- 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