From Jason Turner

[container.adaptors.format]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpb674l8un/{from.md → to.md} +46 -0
tmp/tmpb674l8un/{from.md → to.md} RENAMED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Container adaptors formatting <a id="container.adaptors.format">[[container.adaptors.format]]</a>
2
+
3
+ For each of `queue`, `priority_queue`, and `stack`, the library provides
4
+ the following formatter specialization where `adaptor-type` is the name
5
+ of the template:
6
+
7
+ ``` cpp
8
+ namespace std {
9
+ template<class charT, class T, formattable<charT> Container, class... U>
10
+ struct formatter<adaptor-type<T, Container, U...>, charT> {
11
+ private:
12
+ using maybe-const-container = // exposition only
13
+ fmt-maybe-const<Container, charT>;
14
+ using maybe-const-adaptor = // exposition only
15
+ maybe-const<is_const_v<maybe-const-container>, // see [ranges.syn]
16
+ adaptor-type<T, Container, U...>>;
17
+ formatter<ranges::ref_view<maybe-const-container>, charT> underlying_; // exposition only
18
+
19
+ public:
20
+ template<class ParseContext>
21
+ constexpr typename ParseContext::iterator
22
+ parse(ParseContext& ctx);
23
+
24
+ template<class FormatContext>
25
+ typename FormatContext::iterator
26
+ format(maybe-const-adaptor& r, FormatContext& ctx) const;
27
+ };
28
+ }
29
+ ```
30
+
31
+ ``` cpp
32
+ template<class ParseContext>
33
+ constexpr typename ParseContext::iterator
34
+ parse(ParseContext& ctx);
35
+ ```
36
+
37
+ *Effects:* Equivalent to: `return `*`underlying_`*`.parse(ctx);`
38
+
39
+ ``` cpp
40
+ template<class FormatContext>
41
+ typename FormatContext::iterator
42
+ format(maybe-const-adaptor& r, FormatContext& ctx) const;
43
+ ```
44
+
45
+ *Effects:* Equivalent to: `return `*`underlying_`*`.format(r.c, ctx);`
46
+