std::formatter<std::queue>
來自 cppreference.com
| 定義於標頭檔案 <queue> |
||
| template< class CharT, class T, std::formattable<CharT> Container, class... U > struct formatter<std::queue<T, Container, U...>, CharT>; |
(C++23 起) | |
std::formatter 對容器介面卡型別 std::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::queue<T, Container, U...>>(僅供說明的成員型別*) |
[編輯] 資料成員
| 名稱 | 定義 |
underlying_ |
型別為 std::formatter<ranges::ref_view<maybe-const-container>, CharT> 的底層格式化器(僅用於闡釋的成員物件*) |
[編輯] 成員函式
| parse |
按 range-format-spec 指定解析格式說明符 (公開成員函式) |
| format |
按 range-format-spec 指定寫入範圍格式化輸出 (公開成員函式) |
std::formatter<std::queue>::parse
| template< class ParseContext > constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator; |
||
等價於 return underlying_ .parse(ctx);。
返回值
指向底層容器的 range-format-spec 尾後位置的迭代器。
std::formatter<std::queue>::format
| template< class FormatContext > auto format( /*maybe-const-adaptor*/& r, FormatContext& ctx ) const |
||
等價於 return underlying_ .format(r.c, ctx);。
返回值
指向輸出範圍的尾後位置的迭代器。
[編輯] 示例
| 本節不完整 原因:無示例 |
[編輯] 參閱
| (C++20) |
定義給定型別的格式化規則 (類模板) |
| (C++23) |
有助於實現範圍型別的 std::formatter 特化的類模板 (類模板) |