Espacios de nombres
Variantes

std::iswctype

De cppreference.com
 
 
 
 
<tbody> </tbody>
Definido en el archivo de encabezado <cwctype>
int iswctype( std::wint_t ch, std::wctype_t desc );
Clasifica el carácter ancho wc con categoría LC_CTYPE de la localización actual de C identificada por desc .
Original:
Classifies the wide character wc using the current C locale's LC_CTYPE category identified by desc.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Parámetros

ch -
el carácter amplio de clasificar
Original:
the wide character to classify
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
desc -
la categoría LC_CTYPE, obtenido a partir de una llamada a std::wctype
Original:
the LC_CTYPE category, obtained from a call to std::wctype
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

Es distinto de cero si el ch personaje tiene la propiedad identificada por desc en faceta LC_CTYPE de la actual configuración regional C. .
Original:
Non-zero if the character ch has the property identified by desc in LC_CTYPE facet of the current C locale.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Ejemplo

#include <clocale>
#include <cwctype>
#include <iostream>
bool classify(wchar_t ch, const std::string& cat)
{
    return std::iswctype(ch, std::wctype(cat.c_str()));
}
int main()
{
    std::setlocale(LC_ALL, "ja_JP.UTF-8");
    std::cout << "The character \u6c34 is...\n";
    for(std::string s : {"digit", "alpha", "space", "cntrl", "jkanji"})
        std::cout << s << "? " << std::boolalpha << classify(L'\u6c34', s) << '\n';
}

Salida:

The character 水 is...
digit? false
alpha? true
space? false
cntrl? false
jkanji? true

Ver también

Busca una categoría de clasificación de caracteres en la configuración regional de C actual
(función) [editar]