std::ctype::is(3)
okay bestie, welcome to std::ctype::is(3) from the C++ Standard Libary manual. It's giving "character classification, but make it a C++ standard library specialization" and honestly? iconic π
π NAME π
std::ctype::isβstd::ctype::is(yes bestie, the name section is literally the same thing twice; no notes π)
β¨ Synopsis β¨
Defined in header <locale>
bool is( mask m, char c ) const;
(1)
const char* is( const char* low, const char* high, mask* vec ) const;
(2)
- Checks if the character
cis classified by the maskmaccording to the classification table returned by the member functiontable(). Effectively calculatestable()[(unsigned char)c] & m. - For every character in the character array
[low, high), reads its full classification mask from the classification table returned by the member functiontable()(that is, evaluatestable()[(unsigned char)*p]and stores it in the corresponding element of the array pointed to byvec.
If (unsigned char)c >= std::ctype<char>::table_size, then an implementation-defined value is substituted instead of table()[(unsigned char)c], possibly different for different values of c.
π«Ά Parameters π«Ά
cβ character to classifymβ mask to use for classifying a single characterlowβ pointer to the first character in an array of characters to classifyhighβ one past the end pointer for the array of characters to classifyvecβ pointer to the first element of the array of masks to fill
π Return value π
trueifcis classified bymintable(),falseotherwise.high
π Notes π
Unlike the primary template std::ctype, this specialization does not perform a virtual function call when classifying characters. To customize the behavior, a derived class may provide a non-default classification table to the base class constructor. slay β¨
π Example π
This section is incomplete Reason: no example
the page said it, not me π
π§ Defect reports π§
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
- DR:
LWG 28 - Applied to:
C++98 - Behavior as published: overload
(2)copied the values fromvecintotable(), which is the reverse of the intended behavior - Correct behavior: corrected
π See also π
do_isβ classifies a character or a character sequence[virtual]β virtual protected member function ofstd::ctype<CharT>
π·οΈ Category π·οΈ
* Todo no example
That's the whole page, bestie π«Ά big source/version/date kiss from http://cppreference.com, 2024.06.10, on std::ctype::is(3). π
π¦ 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