std::islower(std::locale)(3)
π NAME π
okay bestie, welcome to std::islower(std::locale)(3) β yes, that's the title β from the C++ Standard Libary manual. This page is literally about std::islower(std::locale): the locale-aware lowercase check. No gatekeeping, we got you. π
β¨ Synopsis β¨
First things first, it's defined in header <locale> β say it with me. β¨
template< class CharT >
bool islower( CharT ch, const locale& loc );
So what does it do? It checks if the given character is classified as a lowercase alphabetic character by the given locale's std::ctype facet. That's the whole vibe check. π
πΈ Parameters πΈ
chβ character. that's the one we're checking, bestie.locβ locale. this is the locale doing the classifying.
π¦ Return value π¦
Returns true if the character is classified as lowercase, false otherwise. periodt. β
π Possible implementation π
Here's how it could look under the hood, no cap:
template<class CharT>
bool islower(CharT ch, const std::locale& loc)
{
return
std::use_facet<std::ctype<CharT>>(loc).is(std::ctype_base::lower, ch);
}
π Example π
Demonstrates the use of islower() with different locales (OS-specific). The original page also has a little // Run this code note. π«Ά
#include <iostream>
#include <locale>
int main()
{
const wchar_t c = L'\u03c0'; // GREEK SMALL LETTER PI
std::locale loc1("C");
std::cout << std::boolalpha
<< "islower('Ο', C locale) returned "
<< std::islower(c, loc1) << '\n'
<< "isupper('Ο', C locale) returned "
<< std::isupper(c, loc1) << '\n';
std::locale loc2("en_US.UTF8");
std::cout << "islower('Ο', Unicode locale) returned "
<< std::islower(c, loc2) << '\n'
<< "isupper('Ο', Unicode locale) returned "
<< std::isupper(c, loc2) << '\n';
}
π Possible output π
islower('Ο', C locale) returned false
isupper('Ο', C locale) returned false
islower('Ο', Unicode locale) returned true
isupper('Ο', Unicode locale) returned false
π See also π
islowerβ checks if a character is lowercase (function).iswlowerβ checks if a wide character is lowercase (function).
and that's the whole page, bestie. source/version/date tea: http://cppreference.com, 2024.06.10, and std::islower(std::locale)(3). mwah πβ¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms