Thread overview | |||||
---|---|---|---|---|---|
|
January 10, 2008 isupper, islower (locale) | ||||
---|---|---|---|---|
| ||||
Hi, I think the ctype tables are wrong. I'm getting isupper (c, loc) == islower (c, loc) for every c in every loc. Example program (which throws instead of returning 0): //---------------------------------------------- Cut here... #include <locale> int main () { if (std::islower ('A', std::locale ())) throw 1; if (std::isupper ('a', std::locale ())) throw 2; return 0; } //---------------------------------------------- ... and here ! Ohh and BTW, shouldn't I be able to write islower ('A', std::locale ()) instead of std::islower (...) ? Thank you for your time and your work on DMC. >:D< |
January 23, 2008 Re: isupper, islower (locale) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Imbecil | Imbecil wrote:
> Ohh and BTW, shouldn't I be able to write
> islower ('A', std::locale ())
> instead of std::islower (...) ?
>
You could use using namespace std; or using std::islower; & using std::locale; in the beginning before main or before the first access to function.
|
January 25, 2008 Re: isupper, islower (locale) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Sunny Pal Singh | Thank you. I will do just that. :) I am not bothered too much by having to qualify the function name with "std::" ; I mentioned this secondary, minor issue, because it seemed to me that there might have been a bug in the compiler. Since the type of the second argument is "locale" from "namespace std", I thought that "namespace std" should have been searched for "isupper"-named functions, according to (my possible mis-understanding of) Koenig lookup: Example 4 (b) http://www.gotw.ca/publications/mill02.htm (The primary, major issue I had was that of wrong ctype results.) Thanks again ! :) |
Copyright © 1999-2021 by the D Language Foundation