GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing timsong-cpp.github.io — [format.tuple] 28 Text processing library [text]28.5 Formatting [format]28.5.9 Tuple formatter [format.tuple]For each of pair and tuple,
the library provides the following formatter specialization
where pair-or-tuple is the name of the template: namespace std {
template<class charT, formattable<charT>... Ts>
struct formatter<pair-or-tuple<Ts...>, charT> {
private:
tuple<formatter<remove_cvref_t<Ts>, charT>...> underlying_; // exposition only
basic_string_view<charT> separator_ = STATICALLY-WIDEN<charT>(", "); // exposition only
basic_string_view<charT> opening-bracket_ = STATICALLY-WIDEN<charT>("("); // exposition only
basic_string_view<charT> closing-bracket_ = STATICALLY-WIDEN<charT>(")"); // exposition only
public:
constexpr void set_separator(basic_string_view<charT> sep) noexcept;
constexpr void set_brackets(basic_string_view<charT> opening,
basic_string_view<charT> closing) noexcept;
template<class ParseContext>
constexpr typename ParseContext::iterator
parse(ParseContext& ctx);
template<class FormatContext>
constexpr typename FormatContext::iterator
format(see below& elems, FormatContext& ctx) const;
};
template<class... Ts>
constexpr bool enable_nonlocking_formatter_optimization<pair-or-tuple<Ts...>> =
(enable_nonlocking_formatter_optimization<remove_cvref_t<Ts>> && ...);
}
The parse member functions of these formatters
interpret the format specification as
a tuple-format-spec according to the following syntax:
tuple-format-spec : tuple-fill-and-alignopt widthopt tuple-typeopt
tuple-fill-and-align : tuple-fillopt align
tuple-fill : any character other than { or } or :
tuple-type : m n The tuple-type specifier
changes the way a pair or tuple is formatted,
with certain options only valid with certain argument types. constexpr void set_separator(basic_string_view<charT> sep) noexcept;
constexpr void set_brackets(basic_string_view<charT> opening,
basic_string_view<charT> closing) noexcept;
template<class ParseContext>
constexpr typename ParseContext::iterator
parse(ParseContext& ctx);
Effects: Parses the format specifiers as a tuple-format-spec and
stores the parsed specifiers in *this. The values of
opening-bracket_,
closing-bracket_, and
separator_
are modified if and only if
required by the tuple-type, if present. For each element e in underlying_,
calls e.parse(ctx) to parse
an empty format-spec and,
if e.set_debug_format() is a valid expression,
calls e.set_debug_format(). template<class FormatContext>
constexpr typename FormatContext::iterator
format(see below& elems, FormatContext& ctx) const;
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |