Mail Archives: djgpp/2001/09/24/02:45:43
On Sun, 23 Sep 2001, Chris wrote:
> i just installed the DJGPP 3.0 i believe.
> it has these files in it gcc30b.zip gpp30b.zip
> i got some things to compile but I couldn't get
> this piece to compile does anybody have any idea
> why this wouldn't
> I get an ERROR no matching function for call to
> transform etc
>
> #include <iostream>
> #include <algorithm>
> #include <cctype>
> #include <string>
> using namespace std;
> int main()
> {
> string s = ("HELLO");
>
> transform(s.begin(),s.end(),s.begin(),tolower);
>
> cout<<s<<endl;
> }
>
Prototype is
int tolower (int);
Argument and return value is expected to be char for template
instantiation as far as I understand. Introducing inline
function:
inline char foo (char ch) { return tolower(ch); }
and using it instead of tolower directly helped for me
(gcc-3.0.2 20010912, i686-pc-linux-gnu)
Anyway it's perhaps more usefull to ask this in some C++
language related mailing list
- Raw text -