|
-
December 18th, 2009, 02:50 PM
#12
Re: no matching function transform?
 Originally Posted by laserlight
Thanks for the link. I tried both with and without "::" and they both worked.
 Originally Posted by laserlight
However, as I implied, there is no guarantee that the non-template version of tolower will be available in the global namespace (unless you #include <ctype.h> instead). A really portable solution is to write a wrapper, e.g.,
Code:
inline char charToLower(char c)
{
return std::tolower(c);
}
// ...
transform(str.begin(), str.end(), str.begin(), charToLower);
Yeah, this one is much better. By the way, I tried also with and without "inline" and they both worked. Do I really need that "inline"?
Thanks,
D.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|