c++ - isupper, islower (locale)
- Imbecil (20/20) Jan 09 2008 Hi,
- Sunny Pal Singh (4/8) Jan 23 2008 You could use using namespace std; or using std::islower; & using
- Imbecil (12/12) Jan 25 2008 Thank you. I will do just that. :)
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<
Jan 09 2008
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.
Jan 23 2008
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 ! :)
Jan 25 2008