類模板
<locale>

std::ctype_byname

template <class charT> class ctype_byname;
字元型別 facet

ctype_byname 標準 facet 過載了 ctype 虛成員,以實現針對特定命名 locale 的語義。

它的公共介面與 ctype 相同,只是它的建構函式接受一個額外的 std_name 引數。

1
explicit ctype_byname (const char* std_name, size_t refs = 0);
1
2
explicit ctype_byname (const char* std_name, size_t refs = 0);
explicit ctype_byname (const string& std_name, size_t refs = 0);

其中 std_name 是一個C locale 的名稱。可用的C locales 取決於系統和庫實現,但至少以下幾種保證在所有實現中都存在:
區域設定名稱描述
"C"最小的 "C" locale(與 locale::classic 相同)
""環境的預設 locale

特化

在所有庫實現中,至少提供了此模板的以下特化:
特化
ctype_byname<char>
ctype_byname<wchar_t>

請注意,與 ctype 一樣,ctype_bynamechar 特化具有特殊的實現(參見 ctype)。