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