Namespaces
Variants

std:: formatter <std::priority_queue>

From cppreference.net

ヘッダーで定義 <queue>
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 の場合に有効になります。

目次

翻訳のポイント: - 「Contents」→「目次」に翻訳 - C++関連の専門用語(Member types, Data members, Member functions, parse, format, Return value, Example, See also)は原文のまま保持 - HTMLタグ、属性、数値は一切変更せず - 構造とフォーマットを完全に維持

メンバー型

名前 定義
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 > 型の基盤フォーマッタ
( 説明専用メンバオブジェクト* )

メンバー関数

parse
range-format-spec で指定されたフォーマット指定子を解析する
(公開メンバ関数)
format
range-format-spec で指定された範囲フォーマット出力を書き込む
(公開メンバ関数)

std::formatter<std::priority_queue>:: parse

template < class ParseContext >
constexpr auto parse ( ParseContext & ctx ) - > ParseContext :: iterator ;

underlying_.parse(ctx) と等価。

戻り値

基となるコンテナの range-format-spec の終端を過ぎたイテレータ。

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 ) ; .

戻り値

出力範囲の終端を過ぎたイテレータ。

関連項目

(C++20)
指定された型のフォーマット規則を定義する
(クラステンプレート)
範囲型に対する std::formatter 特殊化の実装を支援するクラステンプレート
(クラステンプレート)