Name

iswctype function — Tests any category of a wide character

Synopsis

int iswctype(wint_t wc, wctype_t desc)

The iswctype function tests any category of the wide character wc. The category to test is specified by desc, which must be obtained by calling wctype. The setting of the LC_CTYPE category must be the same for the call to iswctype and the call to wctype that returned desc.

Using iswctype, you can implement all the isw . . . functions. For example, you can implement the iswalnum function as follows:

int iswalnum(wint_t wc)
{
  return std::iswctype(wc, std::wctype("alnum"));
}

Get C++ In a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.