2.5 KiB
[format.range.fmtmap]
28 Text processing library [text]
28.5 Formatting [format]
28.5.7 Formatting of ranges [format.range]
28.5.7.4 Specialization of range-default-formatter for maps [format.range.fmtmap]
namespace std {template<ranges::input_range R, class charT>struct range-default-formatter<range_format::map, R, charT> {private:using maybe-const-map = fmt-maybe-const<R, charT>; // exposition onlyusing element-type = // exposition only remove_cvref_t<ranges::range_reference_t<maybe-const-map>>; range_formatter<element-type, charT> underlying_; // exposition onlypublic:constexpr range-default-formatter(); templateconstexpr typename ParseContext::iterator parse(ParseContext& ctx); templatetypename FormatContext::iterator format(maybe-const-map& r, FormatContext& ctx) const; };}
constexpr range-default-formatter();
Mandates: Either:
element-type is a specialization of pair, or
element-type is a specialization of tuple andtuple_size_v<element-type> == 2.
Effects: Equivalent to:underlying_.set_brackets(STATICALLY-WIDEN("{"), STATICALLY-WIDEN("}"));underlying_.underlying().set_brackets({}, {});underlying_.underlying().set_separator(STATICALLY-WIDEN(": "));
template<class ParseContext> constexpr typename ParseContext::iterator parse(ParseContext& ctx);
Effects: Equivalent to: return underlying_.parse(ctx);
template<class FormatContext> typename FormatContext::iterator format(maybe-const-map& r, FormatContext& ctx) const;
Effects: Equivalent to: return underlying_.format(r, ctx);