gcc 3.2 compilation problem]

Gabriel Dos Reis gdr@integrable-solutions.net
Mon Nov 18 12:22:00 GMT 2002


Paul Marculescu <mpaul@gecadsoftware.com> writes:

| Hello.
| 
| I just upgraded to gcc3.2 and I'm trying to compile this code:
| 
| ------------------- cut here ---------------------
| 
| #include <string>
| #include <algorithm>
| #include <cctype>
| #include <iostream
| 
| using namespace std;
| 
| std::string& lower( std::string& p_str )
| {
|     std::transform( p_str.begin(), p_str.end(), p_str.begin(), tolower );
                                                                 ^^^^^^^

This ought to be a FAQ.

Three facts:

  1) std::tolower (resp. std::toupper) is an overloaded function.
  2) C++ has no type for the set of overloaded functions.
  3) Template-argument deduction works by unifying the argument type with
     function parameter types. 

by point 2), point 3) cannot succeed, hence the error.

-- Gaby



More information about the Libstdc++ mailing list