std::formatter<std::priority_queue> - cppreference.com
来自cppreference.com
template< class CharT, class T, std::formattable<CharT> Container, class... U > struct formatter<std::priority_queue<T, Container, U...>, CharT>; |
(C++23 起) | |
std::formatter 针对容器适配器类型 std::priority_queue 的模板特化,允许用户使用格式化函数把底层容器转换为它作为元素汇集的文本表示。
如果 std::formattable<Container, CharT> 为 true 则启用此特化。
成员类型
| 名称 | 定义 |
maybe-const-container
|
fmt-maybe-const <Container, CharT>(仅用于阐述的成员类型*) |
maybe-const-adaptor
|
maybe-const <std::is_const_v<maybe-const-container>,std::priority_queue<T, Container, U...>>(仅用于阐述的成员类型*) |
数据成员
| 名称 | 定义 |
underlying_
|
std::formatter<ranges::ref_view<maybe-const-container>, CharT> 类型的底层格式化器(仅用于阐述的成员对象*) |
成员函数
| 根据 范围格式说明 解析格式说明符 (公开成员函数) | |
| 根据 范围格式说明 写入范围的格式化输出 (公开成员函数) |
std::formatter<std::priority_queue>::parse
template< class ParseContext > constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator; |
||
等价于 return underlying_ .parse(ctx);。
返回值
底层容器的 范围格式说明 的尾后迭代器。
std::formatter<std::priority_queue>::format
template< class FormatContext > auto format( /*maybe-const-adaptor*/& r, FormatContext& ctx ) const -> FormatContext::iterator; |
||
等价于 return underlying_ .format(r.c, ctx);。
返回值
输出范围的尾后迭代器。