std::chrono::operator<<(std::chrono::weekday_indexed)
提供: cppreference.com
< cpp | chrono | weekday indexed
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>("{}[{}]"), wdi.weekday(), wdi.index());}else{ os << std::format(os.getloc(), STATICALLY_WIDEN<CharT>("{}[{} is not a valid index]"), wdi.weekday(), wdi.index());}
ただし STATICALLY_WIDEN<CharT>("...") は CharT
が char
の場合は "..."、 wchar_t
の場合は L"..." です。
[編集] 戻り値
os
。
[編集] 関連項目
(C++20) | 引数の書式化された表現を新しい文字列に格納します (関数テンプレート) |
提供された書式に従って weekday を書式化する std::formatter の特殊化 (クラステンプレートの特殊化) |