std::range-default-formatter<std::range_format::sequence>
来自 cppreference.cn
< cpp | utility | format | ranges formatter
定义于头文件 <format> |
||
template< ranges::input_range R, class CharT > struct /*range-default-formatter*/<range_format::sequence, R, CharT>; |
(自 C++23 起) (仅为说明*) |
|
类模板 /*range-default-formatter*/ 对于范围类型为格式化范围作为元素序列而特化,如果 std::format_kind<R> 是 std::range_format::sequence。
[编辑] 成员类型
成员 | 定义 |
maybe-const-r (私有) |
fmt-maybe-const <R, CharT>(仅为说明的成员类型*) |
[编辑] 数据成员
成员 | 描述 |
std::range_formatter<std::remove_cvref_t< ranges::range_reference_t<maybe-const-r >>, CharT> underlying_ (私有) |
底层格式化器 (仅为说明的成员对象*) |
[编辑] 成员函数
(构造函数) (隐式声明) |
构造一个 /*range-default-formatter*/ (公有成员函数) |
set_separator |
为范围格式化结果设置指定的分隔符 (公有成员函数) |
set_brackets |
为范围格式化结果设置指定的开始和结束括号 (公有成员函数) |
parse |
按照 range-format-spec 指定的方式解析格式说明符 (公有成员函数) |
format |
按照 range-format-spec 指定的方式写入范围格式化输出 (公有成员函数) |
std::range-default-formatter<std::range_format::sequence>::set_separator
constexpr void set_separator( std::basic_string_view<CharT> sep ) noexcept; |
||
等效于调用 underlying_.set_separator(sep)。
std::range-default-formatter<std::range_format::sequence>::set_brackets
constexpr void set_brackets( std::basic_string_view<CharT> opening, std::basic_string_view<CharT> closing ) noexcept; |
||
等效于调用 underlying_.set_brackets(opening, closing)。
std::range-default-formatter<std::range_format::sequence>::parse
template< class ParseContext > constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator; |
||
等效于 return underlying_.parse(ctx);。
返回一个迭代器,指向 range-format-spec 的末尾之后。
std::range-default-formatter<std::range_format::sequence>::format
template< class FormatContext > auto format( /*maybe-const-r*/& elems, FormatContext& ctx ) const -> FormatContext::iterator; |
||
等效于 return underlying_.format(elems, ctx);。
返回一个迭代器,指向输出范围的末尾之后。
[编辑] 另请参阅
(C++20) |
为给定类型定义格式化规则 (类模板) |
(C++23) |
帮助实现 std::formatter 范围类型特化的类模板 (类模板) |