類模板
<locale>

std::time_put_byname

template <class charT, class OutputIterator = ostreambuf_iterator<charT> >  class time_put_byname;
用於格式化日期和時間的 Facet

time_put_byname 標準 facet 重寫了 time_put 的虛成員,以實現其對特定命名 locale 的語義。

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

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

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

特化

在所有庫實現中,至少提供了以下模板的部分特化:
特化
template <class OutputIterator> time_put_byname<char,OutputIterator>
template <class OutputIterator> time_put_byname<wchar_t,OutputIterator>

其中 OutputIterator 應為滿足 *輸出迭代器* 要求,並且能夠遍歷指定字元型別的元素。