namespace std {
template <class charT>
class numpunct_byname : public numpunct<charT>;
}
概要
numpunct_bynameは、名前で指定したロケールの数値の区切り文字に関する情報を提供する、numpunctの派生クラスである。
numpunctの仮想関数を、locale(const char*)で同じ名前を指定して構築したロケールのファセットと等価な意味論で実装する。
このクラスはnumpunctが提供するインタフェースをそのまま継承しており、独自のメンバ関数は持たない。
メンバ関数
publicメンバ関数
| 名前 | 説明 |
|---|---|
(constructor) |
コンストラクタ |
protectedメンバ関数
| 名前 | 説明 |
|---|---|
(destructor) |
デストラクタ |
メンバ型
| 名前 | 説明 |
|---|---|
char_type |
文字型 charT |
string_type |
文字列型 std::basic_string<charT> |
例
#include <iostream>
#include <locale>
int main()
{
// ファセットのデストラクタはprotectedであるため、
// newで確保してlocaleに所有権を渡す
std::locale loc{std::locale::classic(), new std::numpunct_byname<char>{"C"}};
std::cout << std::boolalpha
<< std::has_facet<std::numpunct<char>>(loc) << std::endl;
}
出力
true
バージョン
言語
- C++98