概要
ワイド文字wcが、wctype()で取得した種別descに属するかを判定する。
判定する種別を実行時に指定できるため、iswalpha()のような個別の関数では表せない、ロケールが定義する種別も判定できる。
戻り値
wcが種別descに属すると判定されれば非ゼロの値を、そうでなければ0を返す。
例
#include <cwctype>
#include <iostream>
int main()
{
std::wctype_t digit = std::wctype("digit");
std::cout << std::boolalpha;
std::cout << (std::iswctype(L'1', digit) != 0) << std::endl;
std::cout << (std::iswctype(L'a', digit) != 0) << std::endl;
}
出力
true
false
バージョン
言語
- C++98