std::basic_format_parse_context
提供: cppreference.com
ヘッダ <format> で定義 | ||
template<class CharT> class basic_format_parse_context; | (1) | (C++20以上) |
using format_parse_context = basic_format_parse_context<char>; | (2) | (C++20以上) |
using wformat_parse_context = basic_format_parse_context<wchar_t>; | (3) | (C++20以上) |
解析中の書式文字列範囲および自動インデックスのための引数カウンタから構成される書式文字列解析状態へのアクセスを提供します。
basic_format_parse_context
のインスタンスは書式指定を解析するときに Formatter に渡されます。
目次 |
[編集]メンバ型
型 | 定義 |
char_type | CharT |
iterator | std::basic_string_view<CharT>::const_iterator |
const_iterator | std::basic_string_view<CharT>::const_iterator |
[編集]メンバ関数
コンストラクタ | 書式文字列と引数カウントから std::basic_format_parse_context のインスタンスを構築します。 (パブリックメンバ関数) |
operator= [削除] | std::basic_format_parse_context はコピー可能ではありません。 (パブリックメンバ関数) |
begin | 書式文字列範囲の先頭を指すイテレータを返します。 (パブリックメンバ関数) |
end | 書式文字列範囲の終端を指すイテレータを返します。 (パブリックメンバ関数) |
advance_to | 先頭イテレータを指定された位置に前進させます。 (パブリックメンバ関数) |
next_arg_id | 自動インデックスモードに入り、次の引数インデックスを返します。 (パブリックメンバ関数) |
check_arg_id | 手動インデックスモードに入り、指定された引数インデックスが範囲内かどうか調べます。 (パブリックメンバ関数) |
std::basic_format_parse_context::basic_format_parse_context
constexprexplicit basic_format_parse_context(std::basic_string_view<CharT> fmt, std::size_t num_args =0)noexcept; | (1) | |
basic_format_parse_context(const basic_format_parse_context&)= delete; | (2) | |
1)
std::basic_format_parse_context
のインスタンスを構築します。 書式文字列範囲を [fmt.begin(), fmt.end())
に、引数カウントを num_args
に書式化します。2) コピーコンストラクタは削除されています。
std::basic_format_parse_context
はコピー可能ではありません。 std::basic_format_parse_context::begin
constexpr const_iterator begin()constnoexcept; | ||
Returns an iterator to the beginning of the format string range.
std::basic_format_parse_context::end
constexpr const_iterator end()constnoexcept; | ||
書式文字列範囲の終端を指すイテレータを返します。
std::basic_format_parse_context::advance_to
constexprvoid advance_to(const_iterator it); | ||
書式文字列範囲の先頭を it
に設定します。 advance_to
の呼び出しの後、後続の begin()
の呼び出しは it
のコピーを返します。
it
から end()
が到達可能でない場合、動作は未定義です。
std::basic_format_parse_context::next_arg_id
constexprstd::size_t next_arg_id(); | ||
自動引数インデックスモードに入り、次の自動インデックス (0から始まります) を返します。
*this
が既に手動引数インデックスモードに入っている場合は、 std::format_error を投げます。
std::basic_format_parse_context::check_arg_id
constexprvoid check_arg_id(std::size_t id); | ||
手動引数インデックスモードに入ります。
*this
が既に自動引数インデックスモードに入っている場合は、 std::format_error を投げます。
id
がコンストラクタに提供された引数より大きいまたは等しい場合、呼び出しは定数式ではありません。
[編集]例
This section is incomplete Reason: no example |