std::chrono::operator<<(std::chrono::sys_time)
From cppreference.com
< cpp | chrono | system clock
| ヘッダー <chrono> で定義 |
||
| template< class CharT, class Traits, class Duration > std::basic_ostream<CharT, Traits>& |
(1) | (C++20以降) |
| template< class CharT, class Traits, class Duration > std::basic_ostream<CharT, Traits>& |
(2) | (C++20以降) |
ストリーム os に tp を出力します。
1) 同値:
return os << std::format(os.getloc(), STATICALLY-WIDEN<CharT>("{:L%F %T}"), tp);
ここで、STATICALLY_WIDEN<CharT>("{:L%F %T}") は、CharT が char の場合は "{:L%F %T}"、CharT が wchar_t の場合は L"{:L%F %T}" です。
2) os << std::chrono::year_month_day(tp); と同等です。
[編集] 戻り値
os
[編集] 欠陥報告
以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。
| DR | 適用対象 | 公開された動作 | 正しい動作 |
|---|---|---|---|
| P2372R3 | C++20 | 指定されたロケールがデフォルトで使用されました | 指定されたロケールを使用するにはLが必要です |
[編集] 関連項目
sys_time の書式設定サポート(クラス テンプレートの特殊化) | |
| (C++20) |
引数のフォーマット済み表現を新しい文字列に格納する (関数テンプレート) |
| (C++20) |
year_month_day をストリームに出力する(関数テンプレート) |