[format.range.fmtstr] # 28 Text processing library [[text]](./#text) ## 28.5 Formatting [[format]](format#range.fmtstr) ### 28.5.7 Formatting of ranges [[format.range]](format.range#fmtstr) #### 28.5.7.6 Specialization of *range-default-formatter* for strings [format.range.fmtstr] [🔗](#lib:range-default-formatter) namespace std {templaterequires (K == range_format::string || K == range_format::debug_string)struct *range-default-formatter* {private: formatter, charT> *underlying_*; // *exposition only*public:templateconstexpr typename ParseContext::iterator parse(ParseContext& ctx); templatetypename FormatContext::iterator format(*see below*& str, FormatContext& ctx) const; };} [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L8373) *Mandates*: [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")>, charT> is true[.](#1.sentence-1) [🔗](#lib:parse,range-default-formatter) `template constexpr typename ParseContext::iterator parse(ParseContext& ctx); ` [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L8386) *Effects*: Equivalent to:auto i = *underlying_*.parse(ctx);if constexpr (K == range_format::debug_string) {*underlying_*.set_debug_format();}return i; [🔗](#lib:format,range-default-formatter) `template typename FormatContext::iterator format(see below& r, FormatContext& ctx) const; ` [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L8406) The type of r is const R& if ranges​::​[input_range](range.refinements#concept:input_range "25.4.6 Other range refinements [range.refinements]") is true andR& otherwise[.](#3.sentence-1) [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L8411) *Effects*: Let *s* be a basic_string such thatranges​::​equal(*s*, r) is true[.](#4.sentence-1) Equivalent to: return *underlying_*.format(*s*, ctx);