[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tolower - std namespace?
From: |
Jeff Schwab |
Subject: |
Re: tolower - std namespace? |
Date: |
Fri, 14 Mar 2008 20:57:14 -0700 |
User-agent: |
Thunderbird 2.0.0.12 (X11/20080213) |
sanjeev.sapkota@gmail.com wrote:
Hi everyone,
I've read multiple posts about how to get the 'tolower' function to
work in gcc. From what I understand, the problem is that there are two
versions - you must cast to specify which version you want to use.
transform(tempString.begin(),tempString.end(),tempString.begin(),
(int(*)(int))std::tolower);
Forget the cast and specify ::tolower.
This works with gcc, but not with MS Visual Studio 2003. It only works
with MS Visual Studio 2003 if you remove the std::.
...
So, if the problem *is* because the std::tolower version takes 2
arguments (and not one), this lead me to ask why it works in gcc? The
only reason I can think of is maybe perhaps the gcc implementation of
std::tolower provides some parameter defaults, which the MS version
does not?
Why not test your hypothesis? Try calling std::tolower with one argument.
PS: I'm finding that writing portable code when using a STANDARD
library is much harder than I would think it is *sigh*
What are you actually trying to do?