This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: gcc 3.2 compilation problem]
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Paul Marculescu <mpaul at gecadsoftware dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: 18 Nov 2002 18:35:58 +0100
- Subject: Re: gcc 3.2 compilation problem]
- Organization: Integrable Solutions
- References: <3DD92385.6010500@gecadsoftware.com>
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