Namespaces
Variants

std::chrono:: operator<< (std::chrono::weekday_indexed)

From cppreference.net
定義ヘッダー <chrono>
template < class CharT, class Traits >

std:: basic_ostream < CharT, Traits > &
operator << ( std:: basic_ostream < CharT, Traits > & os,

const std:: chrono :: weekday_indexed & wdi ) ;
(C++20以降)

wdi のテキスト表現をストリーム os に出力します。以下のように動作します:

if ( wdi. index ( ) >= 1 && wdi. index ( ) <= 5 )
os << std:: format ( os. getloc ( ) , STATICALLY_WIDEN < CharT > ( "{:L}[{}]" ) ,
wdi. weekday ( ) , wdi. index ( ) ) ;
else
os << std:: format ( os. getloc ( ) , STATICALLY_WIDEN < CharT > ( "{:L}[{}は有効なインデックスではありません]" ) ,
wdi. weekday ( ) , wdi. index ( ) ) ;

STATICALLY_WIDEN < CharT > ( "..." ) は、 "..." CharT char の場合、および L "..." CharT wchar_t の場合です。

戻り値

os

不具合報告

以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。

DR 適用対象 公開時の動作 正しい動作
P2372R3 C++20 デフォルトで指定されたロケールが使用されていた L を指定して与えられたロケールを使用する必要がある

関連項目

(C++20)
引数の書式化された表現を新しい文字列に格納する
(関数テンプレート)
weekday の書式化サポート
(クラステンプレートの特殊化)