From Jason Turner

[format.args]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp_nvcd97i/{from.md → to.md} +48 -0
tmp/tmp_nvcd97i/{from.md → to.md} RENAMED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### Class template `basic_format_args` <a id="format.args">[[format.args]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class Context>
6
+ class basic_format_args {
7
+ size_t size_; // exposition only
8
+ const basic_format_arg<Context>* data_; // exposition only
9
+
10
+ public:
11
+ basic_format_args() noexcept;
12
+
13
+ template<class... Args>
14
+ basic_format_args(const format-arg-store<Context, Args...>& store) noexcept;
15
+
16
+ basic_format_arg<Context> get(size_t i) const noexcept;
17
+ };
18
+ }
19
+ ```
20
+
21
+ An instance of `basic_format_args` provides access to formatting
22
+ arguments.
23
+
24
+ ``` cpp
25
+ basic_format_args() noexcept;
26
+ ```
27
+
28
+ *Effects:* Initializes `size_` with `0`.
29
+
30
+ ``` cpp
31
+ template<class... Args>
32
+ basic_format_args(const format-arg-store<Context, Args...>& store) noexcept;
33
+ ```
34
+
35
+ *Effects:* Initializes `size_` with `sizeof...(Args)` and `data_` with
36
+ `store.args.data()`.
37
+
38
+ ``` cpp
39
+ basic_format_arg<Context> get(size_t i) const noexcept;
40
+ ```
41
+
42
+ *Returns:* `i < size_ ? data_[i] : basic_format_arg<Context>()`.
43
+
44
+ [*Note 1*: Implementations are encouraged to optimize the
45
+ representation of `basic_format_args` for small number of formatting
46
+ arguments by storing indices of type alternatives separately from values
47
+ and packing the former. — *end note*]
48
+