std::formatter<std::stack>
From cppreference.com
| ヘッダ <stack> で定義 |
||
| template< class CharT, class T, std::formattable<CharT> Container, class... U > struct formatter<std::stack<T, Container, U...>, CharT>; |
(C++23から) | |
コンテナアダプター型 std::stack の std::formatter のテンプレート特殊化により、ユーザーは基になるコンテナを、フォーマット関数を使用して要素のコレクションとしてのテキスト表現に変換できます。
特殊化は、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::stack<T, Container, U...>>(説明専用メンバ型*) |
[編集] データメンバー
| 名前 | 定義 |
underlying_ |
基になるフォーマッター。型は std::formatter<ranges::ref_view<maybe-const-container>, CharT> です。(説明用のメンバオブジェクト*) |
[編集] メンバー関数
| parse |
range-format-spec によって指定されたフォーマット指定子を解析します。 (public member function) |
| format |
range-format-spec によって指定された範囲フォーマット出力を書き込みます。 (public member function) |
std::formatter<std::stack>::parse
| template< class ParseContext > constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator; |
||
underlying_ .parse(ctx); に相当します。
戻り値
基になるコンテナの range-format-spec の末尾以降のイテレータ。
std::formatter<std::stack>::format
| template< class FormatContext > auto format( /*maybe-const-adaptor*/& r, FormatContext& ctx ) const |
||
underlying_ .format(r.c, ctx); に相当します。
戻り値
出力範囲の末尾以降のイテレータ。
[編集] 例
| このセクションは未完成です 理由: 例がありません |
[編集] 関連項目
| (C++20) |
与えられた型のフォーマット規則を定義する (クラステンプレート) |
| (C++23) |
範囲型の std::formatter 特殊化の実装を助けるクラステンプレート (クラステンプレート) |