namespace std {
typedef implementation-defined wctrans_t; // C++98
using wctrans_t = implementation-defined; // C++17
}
概要
ワイド文字の変換規則を表すスカラ型。
wctrans()が返す値を保持し、towctrans()に渡して変換に使用する。これにより、towlower()・towupper()では表せない、ロケールが定義する変換も行える。
備考
- C++17より前の規格では、
<cwctype>の内容はC言語の<wctype.h>と同じであるとだけ規定されており、宣言は明示されていなかった。C++17で、C標準ライブラリのヘッダに対する宣言の一覧が規格へ追加された
例
#include <cwctype>
#include <iostream>
int main()
{
// 「大文字へ変換する」規則を取得する
std::wctrans_t upper = std::wctrans("toupper");
std::wcout << static_cast<wchar_t>(std::towctrans(L'a', upper)) << std::endl;
}
出力
A
バージョン
言語
- C++98