std::chrono::operator<<(std::chrono::weekday_indexed)
來自 cppreference.com
< cpp | chrono | weekday_indexed
定義於標頭檔案 <chrono> |
||
template< class CharT, class Traits > std::basic_ostream<CharT, Traits>& |
(C++20 起) | |
將 wdi 的文字表示輸出到流 os,如同透過
if (wdi.index() >=1 && wdi.index() <= 5)
os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L}[{}]"),
wdi.weekday(), wdi.index());
否則
os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:L}[{} is not a valid index]"),
wdi.weekday(), wdi.index());
其中 STATICALLY_WIDEN<CharT>("...") 為 "..." (如果 CharT
為 char)或 L"..." (如果 CharT
為 wchar_t)。
[編輯] 返回值
os
[編輯] 缺陷報告
下列更改行為的缺陷報告追溯地應用於以前出版的 C++ 標準。
缺陷報告 | 應用於 | 釋出時的行為 | 正確的行為 |
---|---|---|---|
P2372R3 | C++20 | 預設使用給定區域設定 | 需要 L 才能使用給定區域設定 |
[編輯] 參閱
(C++20) |
將引數的格式化表示儲存在新字串中 (函式模板) |
weekday 的格式化支援(類模板特化) |