std::chrono::operator<<(std::chrono::month)
提供: cppreference.com
<tbody>
</tbody>
template <class CharT, class Traits> std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const std::chrono::month& m); |
(C++20以上) | |
!m.ok() の場合は、 unsigned(m) の後に " is not a valid month" が続いたものを os に挿入します。 そうでなければ、 os に紐付けられているロケールを使用して決定された、 m が表す月の名前の省略形から、 std::basic_string<CharT> を形成し、それを os に挿入します。
これは以下と同等です。
return os << (m.ok() ? std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{:%b}"), m) : std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{} is not a valid month"), unsigned(m)));
ただし STATICALLY_WIDEN<CharT>("...") は CharT が char の場合は "..."、 wchar_t の場合は L"..." です。
戻り値
os。
関連項目
(C++20) |
引数の書式化された表現を新しい文字列に格納します (関数テンプレート) |
提供された書式に従って month を書式化する std::formatter の特殊化 (クラステンプレートの特殊化) |