[format.range.fmtstr] (original) (raw)
28 Text processing library [text]
28.5 Formatting [format]
28.5.7 Formatting of ranges [format.range]
28.5.7.6 Specialization of range-default-formatter for strings [format.range.fmtstr]
namespace std { template<range_format K, ranges::input_range R, class charT> requires (K == range_format::string || K == range_format::debug_string) struct range-default-formatter<K, R, charT> { private: formatter<basic_string<charT>, charT> underlying_; public: template<class ParseContext> constexpr typename ParseContext::iterator parse(ParseContext& ctx);template<class FormatContext> typename FormatContext::iterator format(see below& str, FormatContext& ctx) const;};}
Mandates: same_as<remove_cvref_t<range_reference_t<R>>, charT>is true.
template<class ParseContext> constexpr typename ParseContext::iterator parse(ParseContext& ctx);
Effects: Equivalent to:auto i = underlying_.parse(ctx);if constexpr (K == range_format::debug_string) { underlying_.set_debug_format();} return i;
template<class FormatContext> typename FormatContext::iterator format(_see below_& r, FormatContext& ctx) const;
The type of r is const R&if ranges::input_range<const R> is true andR& otherwise.
Effects: Let s be a basic_string<charT> such thatranges::equal(s, r) is true.
Equivalent to: return underlying_.format(s, ctx);