This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Iterator bug?
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: "Einar Otto Stangvik" <einar at grep dot no>
- Cc: <bug-gcc at gnu dot org>
- Date: 31 Oct 2002 04:06:47 +0100
- Subject: Re: Iterator bug?
- Organization: Integrable Solutions
- References: <000701c28074$5f015640$0600a8c0@mason>
"Einar Otto Stangvik" <einar@grep.no> writes:
| uname -a
| Linux monastery 2.4.19-grsec #6 SMP Tue Aug 27 14:05:00 CEST 2002 i686 unknown
|
| gcc -v
| Reading specs from /usr/local/lib/gcc-lib/i686-pc-linux-gnu/3.2/specs
| Configured with: ../gcc-3.1.1/configure
| Thread model: posix
| gcc version 3.2
|
| Possible bug:
| If the header 'iterator' is included, the following will fail:
|
| #include <string>
| #include <algorithm>
| #include <cctype>
| #include <iterator>
|
| using namespace std;
|
| int main(int argc, char *argv[])
| {
| string a = "hello";
| string b;
| transform(a.begin(), a.end(), b.begin(), toupper);
As writte,, this is not a bug in the compiler; and it is a known issue
in the C++ community: the above construct is not required to work.
The point being that std::toupper is an overloaded function and C++
has no type for the address of an overloaded function. You ought to
disambiguate by hand.
-- Gaby