std::formatter<std::stack>
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Containers library
(C++17)
(C++11)
(C++26)
(C++26)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++23)
(C++23)
(C++23)
(C++23)
(C++20)
(C++23)
Tables
std::stack
Defined in header
<stack>
template< class CharT, class T, std::formattable <CharT> Container, class... U >
struct formatter<std::stack <T, Container, U...>, CharT>;
(since C++23)
struct formatter<std::stack <T, Container, U...>, CharT>;
The template specialization of std::formatter for the container adaptor type std::stack allows users to convert the underlying container to its textual representation as a collection of elements using formatting functions.
The specialization is enabled if std::formattable <Container, CharT> is true.
Contents
[edit] Member types
Name
Definition
maybe-const-container
fmt-maybe-const
<Container, CharT>(exposition-only member type*)
maybe-const-adaptor
maybe-const <
std::is_const_v <maybe-const-container
>,
std::stack <T, Container, U...>>(exposition-only member type*)
[edit] Data members
Name
Definition
underlying_
underlying formatter of type std::formatter <ranges::ref_view <maybe-const-container
>, CharT>(exposition-only member object*)
[edit] Member functions
parse
(public member function)
format
(public member function)
std::formatter<std::stack>::parse
template< class ParseContext >
constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator;
constexpr auto parse( ParseContext& ctx ) -> ParseContext::iterator;
Equivalent to return
underlying_
.parse(ctx);.
Return value
An iterator past the end of the range-format-spec of the underlying container.
std::formatter<std::stack>::format
template< class FormatContext >
auto format( /*maybe-const-adaptor*/& r, FormatContext& ctx ) const
Equivalent to return
underlying_
.format(r.c, ctx);.
Return value
An iterator past the end of the output range.
[edit] Example
This section is incomplete
Reason: no example
Reason: no example
[edit] See also
(C++23)
(class template) [edit]