名前空間
変種
操作

std::chrono::operator<<(std::chrono::year_month)

From cppreference.com
< cpp‎ | chrono‎ | year month
 
 
 
 
ヘッダー <chrono> で定義
template< class CharT, class Traits >

std::basic_ostream<CharT, Traits>&

    operator<<( std::basic_ostream<CharT, Traits>& os, const std::chrono::year_month& ym );
(C++20以降)

ym のテキスト表現をストリーム os に出力します。これは、以下のように動作します。

os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{}/{:L}"), ym.year(), ym.month())

ここで、STATICALLY_WIDEN<CharT>("{}/{:L}") は、CharTchar の場合は "{}/{:L}"CharTwchar_t の場合は L"{}/{:L}" です。

目次

[編集] 戻り値

os

[編集]

[編集] 不具合報告

以下の動作変更を伴う欠陥報告が、以前に公開されたC++標準に遡って適用されました。

DR 適用対象 公開された動作 正しい動作
P2372R3 C++20 指定されたロケールがデフォルトで使用されました 指定されたロケールを使用するにはLが必要です

[編集] 関連項目

(C++20)
引数のフォーマット済み表現を新しい文字列に格納する
(関数テンプレート) [編集]
year_month の書式設定サポート
(クラス テンプレートの特殊化) [edit]
English 日本語 中文(简体) 中文(繁體)