std::vformat
提供: cppreference.com
ヘッダ <format> で定義
|
||
std::string vformat(std::string_view fmt, std::format_args args); |
(1) | (C++20以上) |
std::wstring vformat(std::wstring_view fmt, std::wformat_args args); |
(2) | (C++20以上) |
std::string vformat(const std::locale& loc, std::string_view fmt, std::format_args args); |
(3) | (C++20以上) |
std::wstring vformat(const std::locale& loc, std::wstring_view fmt, std::wformat_args args); |
(4) | (C++20以上) |
書式文字列 fmt
に従って args
によって保持されている引数を書式化し、その結果を文字列として返します。 存在する場合はロケール固有の書式化のために loc
が使用されます。
目次 |
[編集] 引数
fmt | - | 書式文字列を表す文字列ビュー。
書式文字列は以下から構成されます。
置換フィールドは以下の形式を持ちます。
arg-id は書式化に使用する値を持つ 書式指定は対応する引数のための std::formatter の特殊化によって定義されます。
|
args | - | 書式化する引数。 |
loc | - | ロケール固有の書式化のために使用される std::locale。 |
[編集] 戻り値
書式化の結果を保持する文字列オブジェクト。
[編集] 例外
fmt
が有効な書式文字列でない場合、 std::format_error を投げます。 いずれかのフォーマッタによって投げられた例外も伝播されます。
This section is incomplete Reason: the second sentence is not backed by the draft standard |
[編集] 例
This section is incomplete Reason: no example |