std:: vformat_to
|
ヘッダーで定義
<format>
|
||
|
template
<
class
OutputIt
>
OutputIt vformat_to ( OutputIt out, std:: string_view fmt, std:: format_args args ) ; |
(1) | (C++20以降) |
|
template
<
class
OutputIt
>
OutputIt vformat_to ( OutputIt out, std:: wstring_view fmt, std:: wformat_args args ) ; |
(2) | (C++20以降) |
|
template
<
class
OutputIt
>
OutputIt vformat_to
(
OutputIt out,
const
std::
locale
&
loc,
|
(3) | (C++20以降) |
|
template
<
class
OutputIt
>
OutputIt vformat_to
(
OutputIt out,
const
std::
locale
&
loc,
|
(4) | (C++20以降) |
args に保持されている引数を、書式文字列 fmt に従ってフォーマットし、結果を出力イテレータ out に書き込みます。存在する場合、 loc はロケール固有のフォーマットに使用されます。
CharT
を
decltype
(
fmt
)
::
char_type
とする
(
char
はオーバーロード
(1,3)
用、
wchar_t
はオーバーロード
(2,4)
用)。
これらのオーバーロードは、
OutputIt
がコンセプト
std::
output_iterator
<
const
CharT
&
>
を満たす場合にのみ、オーバーロード解決に参加します。
OutputIt
は概念
std::
output_iterator
<
const
CharT
&
>
の要件を満たさなければならず、かつ
std::
formatter
<
Ti, CharT
>
は引数の型に含まれるあらゆる
Ti
に対して
Formatter
要件を満たさなければなりません。これらの条件が満たされない場合、動作は未定義です。
目次 |
パラメータ
| out | - | 出力バッファへのイテレータ | ||||||||||||||||||||||||||||||||||||||||||||||
| fmt | - |
フォーマット文字列を表すオブジェクト。フォーマット文字列は以下から構成される:
各置換フィールドは以下の形式を持つ:
1)
フォーマット指定なしの置換フィールド
2)
フォーマット指定ありの置換フィールド
|
||||||||||||||||||||||||||||||||||||||||||||||
| args | - | フォーマットされる引数 | ||||||||||||||||||||||||||||||||||||||||||||||
| loc | - | ロケール固有のフォーマットに使用される std::locale | ||||||||||||||||||||||||||||||||||||||||||||||
戻り値
出力範囲の終端を超えたイテレータ。
例外
指定された引数に対して std::format_error をスローする( fmt が有効なフォーマット文字列でない場合)。また、フォーマッタまたはイテレータ操作でスローされた例外を伝播する。
例
|
このセクションは不完全です
理由: 例がありません |
欠陥報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| P2216R3 | C++20 |
args
の型は
OutputIt
に対してパラメータ化されている
|
パラメータ化されていない |