From Jason Turner

[format.range.fmtstr]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpcjda05u3/{from.md → to.md} +54 -0
tmp/tmpcjda05u3/{from.md → to.md} RENAMED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Specialization of *`range-default-formatter`* for strings <a id="format.range.fmtstr">[[format.range.fmtstr]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<range_format K, ranges::input_range R, class charT>
6
+ requires (K == range_format::string || K == range_format::debug_string)
7
+ struct range-default-formatter<K, R, charT> {
8
+ private:
9
+ formatter<basic_string<charT>, charT> underlying_; // exposition only
10
+
11
+ public:
12
+ template<class ParseContext>
13
+ constexpr typename ParseContext::iterator
14
+ parse(ParseContext& ctx);
15
+
16
+ template<class FormatContext>
17
+ typename FormatContext::iterator
18
+ format(see below& str, FormatContext& ctx) const;
19
+ };
20
+ }
21
+ ```
22
+
23
+ *Mandates:* `same_as<remove_cvref_t<range_reference_t<R>>, charT>` is
24
+ `true`.
25
+
26
+ ``` cpp
27
+ template<class ParseContext>
28
+ constexpr typename ParseContext::iterator
29
+ parse(ParseContext& ctx);
30
+ ```
31
+
32
+ *Effects:* Equivalent to:
33
+
34
+ ``` cpp
35
+ auto i = underlying_.parse(ctx);
36
+ if constexpr (K == range_format::debug_string) {
37
+ underlying_.set_debug_format();
38
+ }
39
+ return i;
40
+ ```
41
+
42
+ ``` cpp
43
+ template<class FormatContext>
44
+ typename FormatContext::iterator
45
+ format(see below& r, FormatContext& ctx) const;
46
+ ```
47
+
48
+ The type of `r` is `const R&` if `ranges::input_range<const R>` is
49
+ `true` and `R&` otherwise.
50
+
51
+ *Effects:* Let *`s`* be a `basic_string<charT>` such that
52
+ `ranges::equal(`*`s`*`, r)` is `true`. Equivalent to:
53
+ `return `*`underlying_`*`.format(`*`s`*`, ctx);`
54
+