std::iswblank(3)
okay so bestie, this is the std::iswblank(3) page from the C++ Standard Libary β yes, thatβs literally how the header spells it, iconic β and weβre gonna read it together like the main-character documentation it is π
β¨
π NAME π
std::iswblank β literally std::iswblank. Thatβs the name, no cap. π«Ά
β¨ Synopsis β¨
Defined in header <cwctype>:
int iswblank( std::wint_t ch ); (since C++11)
So what does it do? It checks if the given wide character is classified as a blank character β and yes, that means a whitespace character used to separate words in a sentence β by the current C locale. In the default C locale, only space (0x20) and horizontal tab (0x09) are blank characters. π
β οΈ Danger zone, bestie: if the value ofchis neither representable as awchar_tnor equal to the value of the macroWEOF, the behavior is undefined. Like, donβt do that. π
πΈ Parameters πΈ
chβ wide character. Thatβs the whole parameter list, iconic and minimal. π
β Return value β
Non-zero value if the wide character is a blank character, zero otherwise. Simple as that. β¨
π¦ Notes π¦
ISO 30112 defines POSIX blank characters as Unicode characters U+0009, U+0020, U+1680, U+180E, U+2000..U+2006, U+2008, U+200A, U+205F, and U+3000. So yes, there are way more blank-ish characters in the Unicode universe. π
π Example π
Run this code (the comment literally says // Run this code):
// Run this code
#include <clocale>
#include <cwctype>
#include <iostream>
int main()
{
wchar_t c = L'\u3000'; // Ideographic space (' ')
std::cout << std::hex << std::showbase << std::boolalpha;
std::cout << "in the default locale, iswblank(" << (std::wint_t)c
<< ") = "
<< (bool)std::iswblank(c) << '\n';
std::setlocale(LC_ALL, "en_US.utf8");
std::cout << "in Unicode locale, iswblank(" << (std::wint_t)c << ") = "
<< (bool)std::iswblank(c) << '\n';
}
π Output π
in the default locale, iswblank(0x3000) = false
in Unicode locale, iswblank(0x3000) = true
π₯ See also π₯
isblank(std::locale)β checks if a character is classified as a blank character by a locale (C++11) (function template) π«Άisblankβ checks if a character is a blank character (C++11) (function) β¨- C documentation for
iswblankβ yes, the C version, go off. π
π ASCII values chart (the iconic table) π
okay so the page also has this big ASCII values table, and the header names these columns: ASCII values, characters, iscntrl, isprint, isspace, isblank, isgraph, ispunct, isalnum, isalpha, isupper, islower, isdigit, isxdigit, decimal, hexadecimal, octal, iswcntrl, iswprint, iswspace, iswblank, iswgraph, iswpunct, iswalnum, iswalpha, iswupper, iswlower, iswdigit, iswxdigit. The rows below carry the twelve classification values exactly as the page prints them, bestie. π
decimal hexadecimal octal characters iscntrl isprint isspace isblank isgraph ispunct isalnum isalpha isupper islower isdigit isxdigit
0β8 \x0β\x8 \0β\10 control codes (NUL, etc.) β 0 0 0 0 0 0 0 0 0 0 0 0
9 \x9 \11 tab (\t) β 0 0 β 0 β 0 0 0 0 0 0 0 0 0
10β13 \xAβ\xD \12β\15 whitespaces (\n, \v, \f, \r) β 0 0 β 0 0 0 0 0 0 0 0 0 0
14β31 \xEβ\x1F \16β\37 control codes β 0 0 0 0 0 0 0 0 0 0 0 0
32 \x20 \40 space 0 β 0 β 0 β 0 0 0 0 0 0 0 0 0
33β47 \x21β\x2F \41β\57 !"#$%&'()*+,-./ 0 β 0 0 0 β 0 β 0 0 0 0 0 0 0
48β57 \x30β\x39 \60β\71 0123456789 0 β 0 0 0 β 0 0 β 0 0 0 0 β 0 β 0
58β64 \x3Aβ\x40 \72β\100 :;<=>?@ 0 β 0 0 0 β 0 β 0 0 0 0 0 0 0
65β70 \x41β\x46 \101β\106 ABCDEF 0 β 0 0 0 β 0 0 β 0 β 0 β 0 0 0 β 0
71β90 \x47β\x5A \107β\132 GHIJKLMNOPQRSTUVWXYZ 0 β 0 0 0 β 0 0 β 0 β 0 β 0 0 0 0
91β96 \x5Bβ\x60 \133β\140 [\]^_` 0 β 0 0 0 β 0 β 0 0 0 0 0 0 0
97β102 \x61β\x66 \141β\146 abcdef 0 β 0 0 0 β 0 0 β 0 β 0 0 β 0 0 β 0
103β122 \x67β\x7A \147β\172 ghijklmnopqrstuvwxyz 0 β 0 0 0 β 0 0 β 0 β 0 0 β 0 0 0
123β126 \x7Bβ\x7E \172β\176 {|}~ 0 β 0 0 0 β 0 β 0 0 0 0 0 0 0
127 \x7F \177 backspace character (DEL) β 0 0 0 0 0 0 0 0 0 0 0 0
and finally, shoutout to the footer, bestie: source/version http://cppreference.com, date 2024.06.10, manual tag std::iswblank(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