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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
## Formatting <a id="format">[[format]]</a>
|
| 2 |
+
|
| 3 |
+
### Header `<format>` synopsis <a id="format.syn">[[format.syn]]</a>
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std {
|
| 7 |
+
// [format.functions], formatting functions
|
| 8 |
+
template<class... Args>
|
| 9 |
+
string format(string_view fmt, const Args&... args);
|
| 10 |
+
template<class... Args>
|
| 11 |
+
wstring format(wstring_view fmt, const Args&... args);
|
| 12 |
+
template<class... Args>
|
| 13 |
+
string format(const locale& loc, string_view fmt, const Args&... args);
|
| 14 |
+
template<class... Args>
|
| 15 |
+
wstring format(const locale& loc, wstring_view fmt, const Args&... args);
|
| 16 |
+
|
| 17 |
+
string vformat(string_view fmt, format_args args);
|
| 18 |
+
wstring vformat(wstring_view fmt, wformat_args args);
|
| 19 |
+
string vformat(const locale& loc, string_view fmt, format_args args);
|
| 20 |
+
wstring vformat(const locale& loc, wstring_view fmt, wformat_args args);
|
| 21 |
+
|
| 22 |
+
template<class Out, class... Args>
|
| 23 |
+
Out format_to(Out out, string_view fmt, const Args&... args);
|
| 24 |
+
template<class Out, class... Args>
|
| 25 |
+
Out format_to(Out out, wstring_view fmt, const Args&... args);
|
| 26 |
+
template<class Out, class... Args>
|
| 27 |
+
Out format_to(Out out, const locale& loc, string_view fmt, const Args&... args);
|
| 28 |
+
template<class Out, class... Args>
|
| 29 |
+
Out format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args);
|
| 30 |
+
|
| 31 |
+
template<class Out>
|
| 32 |
+
Out vformat_to(Out out, string_view fmt,
|
| 33 |
+
format_args_t<type_identity_t<Out>, char> args);
|
| 34 |
+
template<class Out>
|
| 35 |
+
Out vformat_to(Out out, wstring_view fmt,
|
| 36 |
+
format_args_t<type_identity_t<Out>, wchar_t> args);
|
| 37 |
+
template<class Out>
|
| 38 |
+
Out vformat_to(Out out, const locale& loc, string_view fmt,
|
| 39 |
+
format_args_t<type_identity_t<Out>, char> args);
|
| 40 |
+
template<class Out>
|
| 41 |
+
Out vformat_to(Out out, const locale& loc, wstring_view fmt,
|
| 42 |
+
format_args_t<type_identity_t<Out>, wchar_t> args);
|
| 43 |
+
|
| 44 |
+
template<class Out> struct format_to_n_result {
|
| 45 |
+
Out out;
|
| 46 |
+
iter_difference_t<Out> size;
|
| 47 |
+
};
|
| 48 |
+
template<class Out, class... Args>
|
| 49 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 50 |
+
string_view fmt, const Args&... args);
|
| 51 |
+
template<class Out, class... Args>
|
| 52 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 53 |
+
wstring_view fmt, const Args&... args);
|
| 54 |
+
template<class Out, class... Args>
|
| 55 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 56 |
+
const locale& loc, string_view fmt,
|
| 57 |
+
const Args&... args);
|
| 58 |
+
template<class Out, class... Args>
|
| 59 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 60 |
+
const locale& loc, wstring_view fmt,
|
| 61 |
+
const Args&... args);
|
| 62 |
+
|
| 63 |
+
template<class... Args>
|
| 64 |
+
size_t formatted_size(string_view fmt, const Args&... args);
|
| 65 |
+
template<class... Args>
|
| 66 |
+
size_t formatted_size(wstring_view fmt, const Args&... args);
|
| 67 |
+
template<class... Args>
|
| 68 |
+
size_t formatted_size(const locale& loc, string_view fmt, const Args&... args);
|
| 69 |
+
template<class... Args>
|
| 70 |
+
size_t formatted_size(const locale& loc, wstring_view fmt, const Args&... args);
|
| 71 |
+
|
| 72 |
+
// [format.formatter], formatter
|
| 73 |
+
template<class T, class charT = char> struct formatter;
|
| 74 |
+
|
| 75 |
+
// [format.parse.ctx], class template basic_format_parse_context
|
| 76 |
+
template<class charT> class basic_format_parse_context;
|
| 77 |
+
using format_parse_context = basic_format_parse_context<char>;
|
| 78 |
+
using wformat_parse_context = basic_format_parse_context<wchar_t>;
|
| 79 |
+
|
| 80 |
+
template<class Out, class charT> class basic_format_context;
|
| 81 |
+
using format_context = basic_format_context<unspecified, char>;
|
| 82 |
+
using wformat_context = basic_format_context<unspecified, wchar_t>;
|
| 83 |
+
|
| 84 |
+
// [format.arguments], arguments
|
| 85 |
+
// [format.arg], class template basic_format_arg
|
| 86 |
+
template<class Context> class basic_format_arg;
|
| 87 |
+
|
| 88 |
+
template<class Visitor, class Context>
|
| 89 |
+
see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg);
|
| 90 |
+
|
| 91 |
+
// [format.arg.store], class template format-arg-store
|
| 92 |
+
template<class Context, class... Args> struct format-arg-store; // exposition only
|
| 93 |
+
|
| 94 |
+
template<class Context = format_context, class... Args>
|
| 95 |
+
format-arg-store<Context, Args...>
|
| 96 |
+
make_format_args(const Args&... args);
|
| 97 |
+
template<class... Args>
|
| 98 |
+
format-arg-store<wformat_context, Args...>
|
| 99 |
+
make_wformat_args(const Args&... args);
|
| 100 |
+
|
| 101 |
+
// [format.args], class template basic_format_args
|
| 102 |
+
template<class Context> class basic_format_args;
|
| 103 |
+
using format_args = basic_format_args<format_context>;
|
| 104 |
+
using wformat_args = basic_format_args<wformat_context>;
|
| 105 |
+
|
| 106 |
+
template<class Out, class charT>
|
| 107 |
+
using format_args_t = basic_format_args<basic_format_context<Out, charT>>;
|
| 108 |
+
|
| 109 |
+
// [format.error], class format_error
|
| 110 |
+
class format_error;
|
| 111 |
+
}
|
| 112 |
+
```
|
| 113 |
+
|
| 114 |
+
The class template `format_to_n_result` has the template parameters,
|
| 115 |
+
data members, and special members specified above. It has no base
|
| 116 |
+
classes or members other than those specified.
|
| 117 |
+
|
| 118 |
+
### Format string <a id="format.string">[[format.string]]</a>
|
| 119 |
+
|
| 120 |
+
#### In general <a id="format.string.general">[[format.string.general]]</a>
|
| 121 |
+
|
| 122 |
+
A *format string* for arguments `args` is a (possibly empty) sequence of
|
| 123 |
+
*replacement fields*, *escape sequences*, and characters other than `{`
|
| 124 |
+
and `}`. Let `charT` be the character type of the format string. Each
|
| 125 |
+
character that is not part of a replacement field or an escape sequence
|
| 126 |
+
is copied unchanged to the output. An escape sequence is one of `{{` or
|
| 127 |
+
`}}`. It is replaced with `{` or `}`, respectively, in the output. The
|
| 128 |
+
syntax of replacement fields is as follows:
|
| 129 |
+
|
| 130 |
+
``` bnf
|
| 131 |
+
replacement-field
|
| 132 |
+
'{' arg-idₒₚₜ format-specifierₒₚₜ '}'
|
| 133 |
+
```
|
| 134 |
+
|
| 135 |
+
``` bnf
|
| 136 |
+
arg-id
|
| 137 |
+
'0'
|
| 138 |
+
positive-integer
|
| 139 |
+
```
|
| 140 |
+
|
| 141 |
+
``` bnf
|
| 142 |
+
positive-integer
|
| 143 |
+
nonzero-digit
|
| 144 |
+
positive-integer digit
|
| 145 |
+
```
|
| 146 |
+
|
| 147 |
+
``` bnf
|
| 148 |
+
nonnegative-integer
|
| 149 |
+
digit
|
| 150 |
+
nonnegative-integer digit
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
``` bnf
|
| 154 |
+
nonzero-digit one of
|
| 155 |
+
'1 2 3 4 5 6 7 8 9'
|
| 156 |
+
```
|
| 157 |
+
|
| 158 |
+
``` bnf
|
| 159 |
+
digit one of
|
| 160 |
+
'0 1 2 3 4 5 6 7 8 9'
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
``` bnf
|
| 164 |
+
format-specifier
|
| 165 |
+
':' format-spec
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
``` bnf
|
| 169 |
+
format-spec
|
| 170 |
+
as specified by the formatter specialization for the argument type
|
| 171 |
+
```
|
| 172 |
+
|
| 173 |
+
The *arg-id* field specifies the index of the argument in `args` whose
|
| 174 |
+
value is to be formatted and inserted into the output instead of the
|
| 175 |
+
replacement field. If there is no argument with the index *arg-id* in
|
| 176 |
+
`args`, the string is not a format string for `args`. The optional
|
| 177 |
+
*format-specifier* field explicitly specifies a format for the
|
| 178 |
+
replacement value.
|
| 179 |
+
|
| 180 |
+
[*Example 1*:
|
| 181 |
+
|
| 182 |
+
``` cpp
|
| 183 |
+
string s = format("{0}-{{", 8); // value of s is "8-{"
|
| 184 |
+
```
|
| 185 |
+
|
| 186 |
+
— *end example*]
|
| 187 |
+
|
| 188 |
+
If all *arg-id*s in a format string are omitted (including those in the
|
| 189 |
+
*format-spec*, as interpreted by the corresponding `formatter`
|
| 190 |
+
specialization), argument indices 0, 1, 2, … will automatically be used
|
| 191 |
+
in that order. If some *arg-id*s are omitted and some are present, the
|
| 192 |
+
string is not a format string.
|
| 193 |
+
|
| 194 |
+
[*Note 1*: A format string cannot contain a mixture of automatic and
|
| 195 |
+
manual indexing. — *end note*]
|
| 196 |
+
|
| 197 |
+
[*Example 2*:
|
| 198 |
+
|
| 199 |
+
``` cpp
|
| 200 |
+
string s0 = format("{} to {}", "a", "b"); // OK, automatic indexing
|
| 201 |
+
string s1 = format("{1} to {0}", "a", "b"); // OK, manual indexing
|
| 202 |
+
string s2 = format("{0} to {}", "a", "b"); // not a format string (mixing automatic and manual indexing),
|
| 203 |
+
// throws format_error
|
| 204 |
+
string s3 = format("{} to {1}", "a", "b"); // not a format string (mixing automatic and manual indexing),
|
| 205 |
+
// throws format_error
|
| 206 |
+
```
|
| 207 |
+
|
| 208 |
+
— *end example*]
|
| 209 |
+
|
| 210 |
+
The *format-spec* field contains *format specifications* that define how
|
| 211 |
+
the value should be presented. Each type can define its own
|
| 212 |
+
interpretation of the *format-spec* field. If *format-spec* does not
|
| 213 |
+
conform to the format specifications for the argument type referred to
|
| 214 |
+
by *arg-id*, the string is not a format string for `args`.
|
| 215 |
+
|
| 216 |
+
[*Example 3*:
|
| 217 |
+
|
| 218 |
+
- For arithmetic, pointer, and string types the *format-spec* is
|
| 219 |
+
interpreted as a *std-format-spec* as described in
|
| 220 |
+
[[format.string.std]].
|
| 221 |
+
- For chrono types the *format-spec* is interpreted as a
|
| 222 |
+
*chrono-format-spec* as described in [[time.format]].
|
| 223 |
+
- For user-defined `formatter` specializations, the behavior of the
|
| 224 |
+
`parse` member function determines how the *format-spec* is
|
| 225 |
+
interpreted.
|
| 226 |
+
|
| 227 |
+
— *end example*]
|
| 228 |
+
|
| 229 |
+
#### Standard format specifiers <a id="format.string.std">[[format.string.std]]</a>
|
| 230 |
+
|
| 231 |
+
Each `formatter` specializations described in [[format.formatter.spec]]
|
| 232 |
+
for fundamental and string types interprets *format-spec* as a
|
| 233 |
+
*std-format-spec*.
|
| 234 |
+
|
| 235 |
+
[*Note 1*: The format specification can be used to specify such details
|
| 236 |
+
as field width, alignment, padding, and decimal precision. Some of the
|
| 237 |
+
formatting options are only supported for arithmetic
|
| 238 |
+
types. — *end note*]
|
| 239 |
+
|
| 240 |
+
The syntax of format specifications is as follows:
|
| 241 |
+
|
| 242 |
+
``` bnf
|
| 243 |
+
std-format-spec
|
| 244 |
+
fill-and-alignₒₚₜ signₒₚₜ '#'ₒₚₜ '0'ₒₚₜ widthₒₚₜ precisionₒₚₜ 'L'ₒₚₜ typeₒₚₜ
|
| 245 |
+
```
|
| 246 |
+
|
| 247 |
+
``` bnf
|
| 248 |
+
fill-and-align
|
| 249 |
+
fillₒₚₜ align
|
| 250 |
+
```
|
| 251 |
+
|
| 252 |
+
``` bnf
|
| 253 |
+
fill
|
| 254 |
+
any character other than \{ or \}
|
| 255 |
+
```
|
| 256 |
+
|
| 257 |
+
``` bnf
|
| 258 |
+
align one of
|
| 259 |
+
'< > ^'
|
| 260 |
+
```
|
| 261 |
+
|
| 262 |
+
``` bnf
|
| 263 |
+
sign one of
|
| 264 |
+
'+ -' space
|
| 265 |
+
```
|
| 266 |
+
|
| 267 |
+
``` bnf
|
| 268 |
+
width
|
| 269 |
+
positive-integer
|
| 270 |
+
'{' arg-idₒₚₜ '}'
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
``` bnf
|
| 274 |
+
precision
|
| 275 |
+
'.' nonnegative-integer
|
| 276 |
+
'.' '{' arg-idₒₚₜ '}'
|
| 277 |
+
```
|
| 278 |
+
|
| 279 |
+
``` bnf
|
| 280 |
+
type one of
|
| 281 |
+
'a A b B c d e E f F g G o p s x X'
|
| 282 |
+
```
|
| 283 |
+
|
| 284 |
+
[*Note 2*: The *fill* character can be any character other than `{` or
|
| 285 |
+
`}`. The presence of a fill character is signaled by the character
|
| 286 |
+
following it, which must be one of the alignment options. If the second
|
| 287 |
+
character of *std-format-spec* is not a valid alignment option, then it
|
| 288 |
+
is assumed that both the fill character and the alignment option are
|
| 289 |
+
absent. — *end note*]
|
| 290 |
+
|
| 291 |
+
The *align* specifier applies to all argument types. The meaning of the
|
| 292 |
+
various alignment options is as specified in [[format.align]].
|
| 293 |
+
|
| 294 |
+
[*Example 1*:
|
| 295 |
+
|
| 296 |
+
``` cpp
|
| 297 |
+
char c = 120;
|
| 298 |
+
string s0 = format("{:6}", 42); // value of s0 is "\ \ \ \ 42"
|
| 299 |
+
string s1 = format("{:6}", 'x'); // value of s1 is "x\ \ \ \ \ "
|
| 300 |
+
string s2 = format("{:*<6}", 'x'); // value of s2 is "x*****"
|
| 301 |
+
string s3 = format("{:*>6}", 'x'); // value of s3 is "*****x"
|
| 302 |
+
string s4 = format("{:*^6}", 'x'); // value of s4 is "**x***"
|
| 303 |
+
string s5 = format("{:6d}", c); // value of s5 is "\ \ \ 120"
|
| 304 |
+
string s6 = format("{:6}", true); // value of s6 is "true\ \ "
|
| 305 |
+
```
|
| 306 |
+
|
| 307 |
+
— *end example*]
|
| 308 |
+
|
| 309 |
+
[*Note 3*: Unless a minimum field width is defined, the field width is
|
| 310 |
+
determined by the size of the content and the alignment option has no
|
| 311 |
+
effect. — *end note*]
|
| 312 |
+
|
| 313 |
+
**Table: Meaning of align options** <a id="format.align">[format.align]</a>
|
| 314 |
+
|
| 315 |
+
| Option | Meaning |
|
| 316 |
+
| ------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 317 |
+
| `<` | Forces the field to be aligned to the start of the available space. This is the default for non-arithmetic types, `charT`, and `bool`, unless an integer presentation type is specified. |
|
| 318 |
+
| % `>` | Forces the field to be aligned to the end of the available space. This is the default for arithmetic types other than `charT` and `bool` or when an integer presentation type is specified. |
|
| 319 |
+
| % `^` | Forces the field to be centered within the available space by inserting $\bigl\lfloor \frac{n}{2} \bigr\rfloor$ characters before and $\bigl\lceil \frac{n}{2} \bigr\rceil$ characters after the value, where $n$ is the total number of fill characters to insert. |
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
The *sign* option is only valid for arithmetic types other than `charT`
|
| 323 |
+
and `bool` or when an integer presentation type is specified. The
|
| 324 |
+
meaning of the various options is as specified in [[format.sign]].
|
| 325 |
+
|
| 326 |
+
[*Note 4*: For negative numbers and negative zero the output of
|
| 327 |
+
`to_chars` will already contain the sign so no additional transformation
|
| 328 |
+
is performed. — *end note*]
|
| 329 |
+
|
| 330 |
+
The *sign* option applies to floating-point infinity and NaN.
|
| 331 |
+
|
| 332 |
+
[*Example 2*:
|
| 333 |
+
|
| 334 |
+
``` cpp
|
| 335 |
+
double inf = numeric_limits<double>::infinity();
|
| 336 |
+
double nan = numeric_limits<double>::quiet_NaN();
|
| 337 |
+
string s0 = format("{0:},{0:+},{0:-},{0: }", 1); // value of s0 is "1,+1,1, 1"
|
| 338 |
+
string s1 = format("{0:},{0:+},{0:-},{0: }", -1); // value of s1 is "-1,-1,-1,-1"
|
| 339 |
+
string s2 = format("{0:},{0:+},{0:-},{0: }", inf); // value of s2 is "inf,+inf,inf, inf"
|
| 340 |
+
string s3 = format("{0:},{0:+},{0:-},{0: }", nan); // value of s3 is "nan,+nan,nan, nan"
|
| 341 |
+
```
|
| 342 |
+
|
| 343 |
+
— *end example*]
|
| 344 |
+
|
| 345 |
+
The `#` option causes the *alternate form* to be used for the
|
| 346 |
+
conversion. This option is valid for arithmetic types other than `charT`
|
| 347 |
+
and `bool` or when an integer presentation type is specified, and not
|
| 348 |
+
otherwise. For integral types, the alternate form inserts the base
|
| 349 |
+
prefix (if any) specified in [[format.type.int]] into the output after
|
| 350 |
+
the sign character (possibly space) if there is one, or before the
|
| 351 |
+
output of `to_chars` otherwise. For floating-point types, the alternate
|
| 352 |
+
form causes the result of the conversion of finite values to always
|
| 353 |
+
contain a decimal-point character, even if no digits follow it.
|
| 354 |
+
Normally, a decimal-point character appears in the result of these
|
| 355 |
+
conversions only if a digit follows it. In addition, for `g` and `G`
|
| 356 |
+
conversions, trailing zeros are not removed from the result.
|
| 357 |
+
|
| 358 |
+
If `{ \opt{arg-id} }` is used in a *width* or *precision*, the value of
|
| 359 |
+
the corresponding formatting argument is used in its place. If the
|
| 360 |
+
corresponding formatting argument is not of integral type, or its value
|
| 361 |
+
is negative for *precision* or non-positive for *width*, an exception of
|
| 362 |
+
type `format_error` is thrown.
|
| 363 |
+
|
| 364 |
+
The *positive-integer* in *width* is a decimal integer defining the
|
| 365 |
+
minimum field width. If *width* is not specified, there is no minimum
|
| 366 |
+
field width, and the field width is determined based on the content of
|
| 367 |
+
the field.
|
| 368 |
+
|
| 369 |
+
The *width* of a string is defined as the estimated number of column
|
| 370 |
+
positions appropriate for displaying it in a terminal.
|
| 371 |
+
|
| 372 |
+
[*Note 5*: This is similar to the semantics of the POSIX `wcswidth`
|
| 373 |
+
function. — *end note*]
|
| 374 |
+
|
| 375 |
+
For the purposes of width computation, a string is assumed to be in a
|
| 376 |
+
locale-independent, implementation-defined encoding. Implementations
|
| 377 |
+
should use a Unicode encoding on platforms capable of displaying Unicode
|
| 378 |
+
text in a terminal.
|
| 379 |
+
|
| 380 |
+
[*Note 6*: This is the case for Windows-based and many POSIX-based
|
| 381 |
+
operating systems. — *end note*]
|
| 382 |
+
|
| 383 |
+
For a string in a Unicode encoding, implementations should estimate the
|
| 384 |
+
width of a string as the sum of estimated widths of the first code
|
| 385 |
+
points in its extended grapheme clusters. The extended grapheme clusters
|
| 386 |
+
of a string are defined by UAX \#29. The estimated width of the
|
| 387 |
+
following code points is 2:
|
| 388 |
+
|
| 389 |
+
- `U+1100-U+115F`
|
| 390 |
+
- `U+2329-U+232A`
|
| 391 |
+
- `U+2E80-U+303E`
|
| 392 |
+
- `U+3040-U+A4CF`
|
| 393 |
+
- `U+AC00-U+D7A3`
|
| 394 |
+
- `U+F900-U+FAFF`
|
| 395 |
+
- `U+FE10-U+FE19`
|
| 396 |
+
- `U+FE30-U+FE6F`
|
| 397 |
+
- `U+FF00-U+FF60`
|
| 398 |
+
- `U+FFE0-U+FFE6`
|
| 399 |
+
- `U+1F300-U+1F64F`
|
| 400 |
+
- `U+1F900-U+1F9FF`
|
| 401 |
+
- `U+20000-U+2FFFD`
|
| 402 |
+
- `U+30000-U+3FFFD`
|
| 403 |
+
|
| 404 |
+
The estimated width of other code points is 1.
|
| 405 |
+
|
| 406 |
+
For a string in a non-Unicode encoding, the width of a string is
|
| 407 |
+
unspecified.
|
| 408 |
+
|
| 409 |
+
A zero (`0`) character preceding the *width* field pads the field with
|
| 410 |
+
leading zeros (following any indication of sign or base) to the field
|
| 411 |
+
width, except when applied to an infinity or NaN. This option is only
|
| 412 |
+
valid for arithmetic types other than `charT` and `bool` or when an
|
| 413 |
+
integer presentation type is specified. If the `0` character and an
|
| 414 |
+
*align* option both appear, the `0` character is ignored.
|
| 415 |
+
|
| 416 |
+
[*Example 3*:
|
| 417 |
+
|
| 418 |
+
``` cpp
|
| 419 |
+
char c = 120;
|
| 420 |
+
string s1 = format("{:+06d}", c); // value of s1 is "+00120"
|
| 421 |
+
string s2 = format("{:#06x}", 0xa); // value of s2 is "0x000a"
|
| 422 |
+
string s3 = format("{:<06}", -42); // value of s3 is "-42\ \ \ " (0 is ignored because of < alignment)
|
| 423 |
+
```
|
| 424 |
+
|
| 425 |
+
— *end example*]
|
| 426 |
+
|
| 427 |
+
The *nonnegative-integer* in *precision* is a decimal integer defining
|
| 428 |
+
the precision or maximum field size. It can only be used with
|
| 429 |
+
floating-point and string types. For floating-point types this field
|
| 430 |
+
specifies the formatting precision. For string types, this field
|
| 431 |
+
provides an upper bound for the estimated width of the prefix of the
|
| 432 |
+
input string that is copied into the output. For a string in a Unicode
|
| 433 |
+
encoding, the formatter copies to the output the longest prefix of whole
|
| 434 |
+
extended grapheme clusters whose estimated width is no greater than the
|
| 435 |
+
precision.
|
| 436 |
+
|
| 437 |
+
When the `L` option is used, the form used for the conversion is called
|
| 438 |
+
the *locale-specific form*. The `L` option is only valid for arithmetic
|
| 439 |
+
types, and its effect depends upon the type.
|
| 440 |
+
|
| 441 |
+
- For integral types, the locale-specific form causes the context’s
|
| 442 |
+
locale to be used to insert the appropriate digit group separator
|
| 443 |
+
characters.
|
| 444 |
+
- For floating-point types, the locale-specific form causes the
|
| 445 |
+
context’s locale to be used to insert the appropriate digit group and
|
| 446 |
+
radix separator characters.
|
| 447 |
+
- For the textual representation of `bool`, the locale-specific form
|
| 448 |
+
causes the context’s locale to be used to insert the appropriate
|
| 449 |
+
string as if obtained with `numpunct::truename` or
|
| 450 |
+
`numpunct::falsename`.
|
| 451 |
+
|
| 452 |
+
The *type* determines how the data should be presented.
|
| 453 |
+
|
| 454 |
+
The available string presentation types are specified in
|
| 455 |
+
[[format.type.string]].
|
| 456 |
+
|
| 457 |
+
**Table: Meaning of type options for strings** <a id="format.type.string">[format.type.string]</a>
|
| 458 |
+
|
| 459 |
+
| Type | Meaning |
|
| 460 |
+
| --------- | -------------------------------- |
|
| 461 |
+
| none, `s` | Copies the string to the output. |
|
| 462 |
+
|
| 463 |
+
|
| 464 |
+
The meaning of some non-string presentation types is defined in terms of
|
| 465 |
+
a call to `to_chars`. In such cases, let \[`first`, `last`) be a range
|
| 466 |
+
large enough to hold the `to_chars` output and `value` be the formatting
|
| 467 |
+
argument value. Formatting is done as if by calling `to_chars` as
|
| 468 |
+
specified and copying the output through the output iterator of the
|
| 469 |
+
format context.
|
| 470 |
+
|
| 471 |
+
[*Note 7*: Additional padding and adjustments are performed prior to
|
| 472 |
+
copying the output through the output iterator as specified by the
|
| 473 |
+
format specifiers. — *end note*]
|
| 474 |
+
|
| 475 |
+
The available integer presentation types for integral types other than
|
| 476 |
+
`bool` and `charT` are specified in [[format.type.int]].
|
| 477 |
+
|
| 478 |
+
[*Example 4*:
|
| 479 |
+
|
| 480 |
+
``` cpp
|
| 481 |
+
string s0 = format("{}", 42); // value of s0 is "42"
|
| 482 |
+
string s1 = format("{0:b} {0:d} {0:o} {0:x}", 42); // value of s1 is "101010 42 52 2a"
|
| 483 |
+
string s2 = format("{0:#x} {0:#X}", 42); // value of s2 is "0x2a 0X2A"
|
| 484 |
+
string s3 = format("{:L}", 1234); // value of s3 might be "1,234"
|
| 485 |
+
// (depending on the locale)
|
| 486 |
+
```
|
| 487 |
+
|
| 488 |
+
— *end example*]
|
| 489 |
+
|
| 490 |
+
[*Note 8*: If the formatting argument type is `charT` or `bool`, the
|
| 491 |
+
default is instead `c` or `s`, respectively. — *end note*]
|
| 492 |
+
|
| 493 |
+
The available `charT` presentation types are specified in
|
| 494 |
+
[[format.type.char]].
|
| 495 |
+
|
| 496 |
+
**Table: Meaning of type options for `charT`** <a id="format.type.char">[format.type.char]</a>
|
| 497 |
+
|
| 498 |
+
| Type | Meaning |
|
| 499 |
+
| ------------------------------ | ------------------------------------ |
|
| 500 |
+
| none, `c` | Copies the character to the output. |
|
| 501 |
+
| % `b`, `B`, `d`, `o`, `x`, `X` | As specified in [[format.type.int]]. |
|
| 502 |
+
|
| 503 |
+
|
| 504 |
+
The available `bool` presentation types are specified in
|
| 505 |
+
[[format.type.bool]].
|
| 506 |
+
|
| 507 |
+
**Table: Meaning of type options for `bool`** <a id="format.type.bool">[format.type.bool]</a>
|
| 508 |
+
|
| 509 |
+
| Type | Meaning |
|
| 510 |
+
| ----------------------------------- | -------------------------------------------------------------------------------------- |
|
| 511 |
+
| none, `s` | Copies textual representation, either `true` or `false`, to the output. |
|
| 512 |
+
| % `b`, `B`, `c`, `d`, `o`, `x`, `X` | As specified in [[format.type.int]] for the value `static_cast<unsigned char>(value)`. |
|
| 513 |
+
|
| 514 |
+
|
| 515 |
+
The available floating-point presentation types and their meanings for
|
| 516 |
+
values other than infinity and NaN are specified in
|
| 517 |
+
[[format.type.float]]. For lower-case presentation types, infinity and
|
| 518 |
+
NaN are formatted as `inf` and `nan`, respectively. For upper-case
|
| 519 |
+
presentation types, infinity and NaN are formatted as `INF` and `NAN`,
|
| 520 |
+
respectively.
|
| 521 |
+
|
| 522 |
+
[*Note 9*: In either case, a sign is included if indicated by the
|
| 523 |
+
*sign* option. — *end note*]
|
| 524 |
+
|
| 525 |
+
**Table: Meaning of type options for floating-point types** <a id="format.type.float">[format.type.float]</a>
|
| 526 |
+
|
| 527 |
+
| Type | Meaning |
|
| 528 |
+
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 529 |
+
| `a` | If precision is specified, equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::hex, precision) \end{codeblock} where `precision` is the specified formatting precision; equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::hex) \end{codeblock} otherwise. |
|
| 530 |
+
| % `A` | The same as `a`, except that it uses uppercase letters for digits above 9 and `P` to indicate the exponent. |
|
| 531 |
+
| % `e` | Equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::scientific, precision) \end{codeblock} where `precision` is the specified formatting precision, or `6` if precision is not specified. |
|
| 532 |
+
| % `E` | The same as `e`, except that it uses `E` to indicate exponent. |
|
| 533 |
+
| % `f`, `F` | Equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::fixed, precision) \end{codeblock} where `precision` is the specified formatting precision, or `6` if precision is not specified. |
|
| 534 |
+
| % `g` | Equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::general, precision) \end{codeblock} where `precision` is the specified formatting precision, or `6` if precision is not specified. |
|
| 535 |
+
| % `G` | The same as `g`, except that it uses `E` to indicate exponent. |
|
| 536 |
+
| % none | If precision is specified, equivalent to \begin{codeblock} to_chars(first, last, value, chars_format::general, precision) \end{codeblock} where `precision` is the specified formatting precision; equivalent to \begin{codeblock} to_chars(first, last, value) \end{codeblock} otherwise. |
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
The available pointer presentation types and their mapping to `to_chars`
|
| 540 |
+
are specified in [[format.type.ptr]].
|
| 541 |
+
|
| 542 |
+
[*Note 10*: Pointer presentation types also apply to
|
| 543 |
+
`nullptr_t`. — *end note*]
|
| 544 |
+
|
| 545 |
+
**Table: Meaning of type options for pointer types** <a id="format.type.ptr">[format.type.ptr]</a>
|
| 546 |
+
|
| 547 |
+
| Type | Meaning |
|
| 548 |
+
| --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
| 549 |
+
| none, `p` | If `uintptr_t` is defined, \begin{codeblock} to_chars(first, last, reinterpret_cast<uintptr_t>(value), 16) \end{codeblock} with the prefix `0x` added to the output; otherwise, implementation-defined. |
|
| 550 |
+
|
| 551 |
+
|
| 552 |
+
### Error reporting <a id="format.err.report">[[format.err.report]]</a>
|
| 553 |
+
|
| 554 |
+
Formatting functions throw `format_error` if an argument `fmt` is passed
|
| 555 |
+
that is not a format string for `args`. They propagate exceptions thrown
|
| 556 |
+
by operations of `formatter` specializations and iterators. Failure to
|
| 557 |
+
allocate storage is reported by throwing an exception as described in
|
| 558 |
+
[[res.on.exception.handling]].
|
| 559 |
+
|
| 560 |
+
### Formatting functions <a id="format.functions">[[format.functions]]</a>
|
| 561 |
+
|
| 562 |
+
In the description of the functions, operator `+` is used for some of
|
| 563 |
+
the iterator categories for which it does not have to be defined. In
|
| 564 |
+
these cases the semantics of `a + n` are the same as in
|
| 565 |
+
[[algorithms.requirements]].
|
| 566 |
+
|
| 567 |
+
``` cpp
|
| 568 |
+
template<class... Args>
|
| 569 |
+
string format(string_view fmt, const Args&... args);
|
| 570 |
+
```
|
| 571 |
+
|
| 572 |
+
*Effects:* Equivalent to:
|
| 573 |
+
|
| 574 |
+
``` cpp
|
| 575 |
+
return vformat(fmt, make_format_args(args...));
|
| 576 |
+
```
|
| 577 |
+
|
| 578 |
+
``` cpp
|
| 579 |
+
template<class... Args>
|
| 580 |
+
wstring format(wstring_view fmt, const Args&... args);
|
| 581 |
+
```
|
| 582 |
+
|
| 583 |
+
*Effects:* Equivalent to:
|
| 584 |
+
|
| 585 |
+
``` cpp
|
| 586 |
+
return vformat(fmt, make_wformat_args(args...));
|
| 587 |
+
```
|
| 588 |
+
|
| 589 |
+
``` cpp
|
| 590 |
+
template<class... Args>
|
| 591 |
+
string format(const locale& loc, string_view fmt, const Args&... args);
|
| 592 |
+
```
|
| 593 |
+
|
| 594 |
+
*Effects:* Equivalent to:
|
| 595 |
+
|
| 596 |
+
``` cpp
|
| 597 |
+
return vformat(loc, fmt, make_format_args(args...));
|
| 598 |
+
```
|
| 599 |
+
|
| 600 |
+
``` cpp
|
| 601 |
+
template<class... Args>
|
| 602 |
+
wstring format(const locale& loc, wstring_view fmt, const Args&... args);
|
| 603 |
+
```
|
| 604 |
+
|
| 605 |
+
*Effects:* Equivalent to:
|
| 606 |
+
|
| 607 |
+
``` cpp
|
| 608 |
+
return vformat(loc, fmt, make_wformat_args(args...));
|
| 609 |
+
```
|
| 610 |
+
|
| 611 |
+
``` cpp
|
| 612 |
+
string vformat(string_view fmt, format_args args);
|
| 613 |
+
wstring vformat(wstring_view fmt, wformat_args args);
|
| 614 |
+
string vformat(const locale& loc, string_view fmt, format_args args);
|
| 615 |
+
wstring vformat(const locale& loc, wstring_view fmt, wformat_args args);
|
| 616 |
+
```
|
| 617 |
+
|
| 618 |
+
*Returns:* A string object holding the character representation of
|
| 619 |
+
formatting arguments provided by `args` formatted according to
|
| 620 |
+
specifications given in `fmt`. If present, `loc` is used for
|
| 621 |
+
locale-specific formatting.
|
| 622 |
+
|
| 623 |
+
*Throws:* As specified in [[format.err.report]].
|
| 624 |
+
|
| 625 |
+
``` cpp
|
| 626 |
+
template<class Out, class... Args>
|
| 627 |
+
Out format_to(Out out, string_view fmt, const Args&... args);
|
| 628 |
+
template<class Out, class... Args>
|
| 629 |
+
Out format_to(Out out, wstring_view fmt, const Args&... args);
|
| 630 |
+
```
|
| 631 |
+
|
| 632 |
+
*Effects:* Equivalent to:
|
| 633 |
+
|
| 634 |
+
``` cpp
|
| 635 |
+
using context = basic_format_context<Out, decltype(fmt)::value_type>;
|
| 636 |
+
return vformat_to(out, fmt, make_format_args<context>(args...));
|
| 637 |
+
```
|
| 638 |
+
|
| 639 |
+
``` cpp
|
| 640 |
+
template<class Out, class... Args>
|
| 641 |
+
Out format_to(Out out, const locale& loc, string_view fmt, const Args&... args);
|
| 642 |
+
template<class Out, class... Args>
|
| 643 |
+
Out format_to(Out out, const locale& loc, wstring_view fmt, const Args&... args);
|
| 644 |
+
```
|
| 645 |
+
|
| 646 |
+
*Effects:* Equivalent to:
|
| 647 |
+
|
| 648 |
+
``` cpp
|
| 649 |
+
using context = basic_format_context<Out, decltype(fmt)::value_type>;
|
| 650 |
+
return vformat_to(out, loc, fmt, make_format_args<context>(args...));
|
| 651 |
+
```
|
| 652 |
+
|
| 653 |
+
``` cpp
|
| 654 |
+
template<class Out>
|
| 655 |
+
Out vformat_to(Out out, string_view fmt,
|
| 656 |
+
format_args_t<type_identity_t<Out>, char> args);
|
| 657 |
+
template<class Out>
|
| 658 |
+
Out vformat_to(Out out, wstring_view fmt,
|
| 659 |
+
format_args_t<type_identity_t<Out>, wchar_t> args);
|
| 660 |
+
template<class Out>
|
| 661 |
+
Out vformat_to(Out out, const locale& loc, string_view fmt,
|
| 662 |
+
format_args_t<type_identity_t<Out>, char> args);
|
| 663 |
+
template<class Out>
|
| 664 |
+
Out vformat_to(Out out, const locale& loc, wstring_view fmt,
|
| 665 |
+
format_args_t<type_identity_t<Out>, wchar_t> args);
|
| 666 |
+
```
|
| 667 |
+
|
| 668 |
+
Let `charT` be `decltype(fmt)::value_type`.
|
| 669 |
+
|
| 670 |
+
*Constraints:* `Out` satisfies `output_iterator<const charT&>`.
|
| 671 |
+
|
| 672 |
+
*Preconditions:* `Out` models `output_iterator<const charT&>`.
|
| 673 |
+
|
| 674 |
+
*Effects:* Places the character representation of formatting the
|
| 675 |
+
arguments provided by `args`, formatted according to the specifications
|
| 676 |
+
given in `fmt`, into the range \[`out`, `out + N`), where `N` is
|
| 677 |
+
`formatted_size(fmt, args...)` for the functions without a `loc`
|
| 678 |
+
parameter and `formatted_size(loc, fmt, args...)` for the functions with
|
| 679 |
+
a `loc` parameter. If present, `loc` is used for locale-specific
|
| 680 |
+
formatting.
|
| 681 |
+
|
| 682 |
+
*Returns:* `out + N`.
|
| 683 |
+
|
| 684 |
+
*Throws:* As specified in [[format.err.report]].
|
| 685 |
+
|
| 686 |
+
``` cpp
|
| 687 |
+
template<class Out, class... Args>
|
| 688 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 689 |
+
string_view fmt, const Args&... args);
|
| 690 |
+
template<class Out, class... Args>
|
| 691 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 692 |
+
wstring_view fmt, const Args&... args);
|
| 693 |
+
template<class Out, class... Args>
|
| 694 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 695 |
+
const locale& loc, string_view fmt,
|
| 696 |
+
const Args&... args);
|
| 697 |
+
template<class Out, class... Args>
|
| 698 |
+
format_to_n_result<Out> format_to_n(Out out, iter_difference_t<Out> n,
|
| 699 |
+
const locale& loc, wstring_view fmt,
|
| 700 |
+
const Args&... args);
|
| 701 |
+
```
|
| 702 |
+
|
| 703 |
+
Let
|
| 704 |
+
|
| 705 |
+
- `charT` be `decltype(fmt)::value_type`,
|
| 706 |
+
- `N` be `formatted_size(fmt, args...)` for the functions without a
|
| 707 |
+
`loc` parameter and `formatted_size(loc, fmt, args...)` for the
|
| 708 |
+
functions with a `loc` parameter, and
|
| 709 |
+
- `M` be `clamp(n, 0, N)`.
|
| 710 |
+
|
| 711 |
+
*Constraints:* `Out` satisfies `output_iterator<const charT&>`.
|
| 712 |
+
|
| 713 |
+
*Preconditions:* `Out` models `output_iterator<const charT&>`, and
|
| 714 |
+
`formatter<``Tᵢ``, charT>` meets the
|
| 715 |
+
requirements [[formatter.requirements]] for each `Tᵢ` in `Args`.
|
| 716 |
+
|
| 717 |
+
*Effects:* Places the first `M` characters of the character
|
| 718 |
+
representation of formatting the arguments provided by `args`, formatted
|
| 719 |
+
according to the specifications given in `fmt`, into the range \[`out`,
|
| 720 |
+
`out + M`). If present, `loc` is used for locale-specific formatting.
|
| 721 |
+
|
| 722 |
+
*Returns:* `{out + M, N}`.
|
| 723 |
+
|
| 724 |
+
*Throws:* As specified in [[format.err.report]].
|
| 725 |
+
|
| 726 |
+
``` cpp
|
| 727 |
+
template<class... Args>
|
| 728 |
+
size_t formatted_size(string_view fmt, const Args&... args);
|
| 729 |
+
template<class... Args>
|
| 730 |
+
size_t formatted_size(wstring_view fmt, const Args&... args);
|
| 731 |
+
template<class... Args>
|
| 732 |
+
size_t formatted_size(const locale& loc, string_view fmt, const Args&... args);
|
| 733 |
+
template<class... Args>
|
| 734 |
+
size_t formatted_size(const locale& loc, wstring_view fmt, const Args&... args);
|
| 735 |
+
```
|
| 736 |
+
|
| 737 |
+
Let `charT` be `decltype(fmt)::value_type`.
|
| 738 |
+
|
| 739 |
+
*Preconditions:* `formatter<``Tᵢ``, charT>` meets the
|
| 740 |
+
requirements [[formatter.requirements]] for each `Tᵢ` in `Args`.
|
| 741 |
+
|
| 742 |
+
*Returns:* The number of characters in the character representation of
|
| 743 |
+
formatting arguments `args` formatted according to specifications given
|
| 744 |
+
in `fmt`. If present, `loc` is used for locale-specific formatting.
|
| 745 |
+
|
| 746 |
+
*Throws:* As specified in [[format.err.report]].
|
| 747 |
+
|
| 748 |
+
### Formatter <a id="format.formatter">[[format.formatter]]</a>
|
| 749 |
+
|
| 750 |
+
#### Formatter requirements <a id="formatter.requirements">[[formatter.requirements]]</a>
|
| 751 |
+
|
| 752 |
+
A type `F` meets the requirements if:
|
| 753 |
+
|
| 754 |
+
- it meets the
|
| 755 |
+
- *Cpp17DefaultConstructible* ([[cpp17.defaultconstructible]]),
|
| 756 |
+
- *Cpp17CopyConstructible* ([[cpp17.copyconstructible]]),
|
| 757 |
+
- *Cpp17CopyAssignable* ([[cpp17.copyassignable]]), and
|
| 758 |
+
- *Cpp17Destructible* ([[cpp17.destructible]])
|
| 759 |
+
|
| 760 |
+
requirements,
|
| 761 |
+
- it is swappable [[swappable.requirements]] for lvalues, and
|
| 762 |
+
- the expressions shown in [[formatter]] are valid and have the
|
| 763 |
+
indicated semantics.
|
| 764 |
+
|
| 765 |
+
Given character type `charT`, output iterator type `Out`, and formatting
|
| 766 |
+
argument type `T`, in [[formatter]]:
|
| 767 |
+
|
| 768 |
+
- `f` is a value of type `F`,
|
| 769 |
+
- `u` is an lvalue of type `T`,
|
| 770 |
+
- `t` is a value of a type convertible to (possibly const) `T`,
|
| 771 |
+
- `PC` is `basic_format_parse_context<charT>`,
|
| 772 |
+
- `FC` is `basic_format_context<Out, charT>`,
|
| 773 |
+
- `pc` is an lvalue of type `PC`, and
|
| 774 |
+
- `fc` is an lvalue of type `FC`.
|
| 775 |
+
|
| 776 |
+
`pc.begin()` points to the beginning of the *format-spec*
|
| 777 |
+
[[format.string]] of the replacement field being formatted in the format
|
| 778 |
+
string. If *format-spec* is empty then either `pc.begin() == pc.end()`
|
| 779 |
+
or `*pc.begin() == '}'`.
|
| 780 |
+
|
| 781 |
+
[*Note 1*: This allows formatters to emit meaningful error
|
| 782 |
+
messages. — *end note*]
|
| 783 |
+
|
| 784 |
+
#### Formatter specializations <a id="format.formatter.spec">[[format.formatter.spec]]</a>
|
| 785 |
+
|
| 786 |
+
The functions defined in [[format.functions]] use specializations of the
|
| 787 |
+
class template `formatter` to format individual arguments.
|
| 788 |
+
|
| 789 |
+
Let `charT` be either `char` or `wchar_t`. Each specialization of
|
| 790 |
+
`formatter` is either enabled or disabled, as described below.
|
| 791 |
+
|
| 792 |
+
[*Note 1*: Enabled specializations meet the requirements, and disabled
|
| 793 |
+
specializations do not. — *end note*]
|
| 794 |
+
|
| 795 |
+
Each header that declares the template `formatter` provides the
|
| 796 |
+
following enabled specializations:
|
| 797 |
+
|
| 798 |
+
- The specializations
|
| 799 |
+
``` cpp
|
| 800 |
+
template<> struct formatter<char, char>;
|
| 801 |
+
template<> struct formatter<char, wchar_t>;
|
| 802 |
+
template<> struct formatter<wchar_t, wchar_t>;
|
| 803 |
+
```
|
| 804 |
+
- For each `charT`, the string type specializations
|
| 805 |
+
``` cpp
|
| 806 |
+
template<> struct formatter<charT*, charT>;
|
| 807 |
+
template<> struct formatter<const charT*, charT>;
|
| 808 |
+
template<size_t N> struct formatter<const charT[N], charT>;
|
| 809 |
+
template<class traits, class Allocator>
|
| 810 |
+
struct formatter<basic_string<charT, traits, Allocator>, charT>;
|
| 811 |
+
template<class traits>
|
| 812 |
+
struct formatter<basic_string_view<charT, traits>, charT>;
|
| 813 |
+
```
|
| 814 |
+
- For each `charT`, for each cv-unqualified arithmetic type
|
| 815 |
+
`ArithmeticT` other than `char`, `wchar_t`, `char8_t`, `char16_t`, or
|
| 816 |
+
`char32_t`, a specialization
|
| 817 |
+
``` cpp
|
| 818 |
+
template<> struct formatter<ArithmeticT, charT>;
|
| 819 |
+
```
|
| 820 |
+
- For each `charT`, the pointer type specializations
|
| 821 |
+
``` cpp
|
| 822 |
+
template<> struct formatter<nullptr_t, charT>;
|
| 823 |
+
template<> struct formatter<void*, charT>;
|
| 824 |
+
template<> struct formatter<const void*, charT>;
|
| 825 |
+
```
|
| 826 |
+
|
| 827 |
+
The `parse` member functions of these formatters interpret the format
|
| 828 |
+
specification as a *std-format-spec* as described in
|
| 829 |
+
[[format.string.std]].
|
| 830 |
+
|
| 831 |
+
[*Note 2*: Specializations such as `formatter<wchar_t, char>` and
|
| 832 |
+
`formatter<const char*, wchar_t>` that would require implicit multibyte
|
| 833 |
+
/ wide string or character conversion are disabled. — *end note*]
|
| 834 |
+
|
| 835 |
+
For any types `T` and `charT` for which neither the library nor the user
|
| 836 |
+
provides an explicit or partial specialization of the class template
|
| 837 |
+
`formatter`, `formatter<T, charT>` is disabled.
|
| 838 |
+
|
| 839 |
+
If the library provides an explicit or partial specialization of
|
| 840 |
+
`formatter<T, charT>`, that specialization is enabled except as noted
|
| 841 |
+
otherwise.
|
| 842 |
+
|
| 843 |
+
If `F` is a disabled specialization of `formatter`, these values are
|
| 844 |
+
`false`:
|
| 845 |
+
|
| 846 |
+
- `is_default_constructible_v<F>`,
|
| 847 |
+
- `is_copy_constructible_v<F>`,
|
| 848 |
+
- `is_move_constructible_v<F>`,
|
| 849 |
+
- `is_copy_assignable_v<F>`, and
|
| 850 |
+
- `is_move_assignable_v<F>`.
|
| 851 |
+
|
| 852 |
+
An enabled specialization `formatter<T, charT>` meets the requirements
|
| 853 |
+
[[formatter.requirements]].
|
| 854 |
+
|
| 855 |
+
[*Example 1*:
|
| 856 |
+
|
| 857 |
+
``` cpp
|
| 858 |
+
#include <format>
|
| 859 |
+
|
| 860 |
+
enum color { red, green, blue };
|
| 861 |
+
const char* color_names[] = { "red", "green", "blue" };
|
| 862 |
+
|
| 863 |
+
template<> struct std::formatter<color> : std::formatter<const char*> {
|
| 864 |
+
auto format(color c, format_context& ctx) {
|
| 865 |
+
return formatter<const char*>::format(color_names[c], ctx);
|
| 866 |
+
}
|
| 867 |
+
};
|
| 868 |
+
|
| 869 |
+
struct err {};
|
| 870 |
+
|
| 871 |
+
std::string s0 = std::format("{}", 42); // OK, library-provided formatter
|
| 872 |
+
std::string s1 = std::format("{}", L"foo"); // error: disabled formatter
|
| 873 |
+
std::string s2 = std::format("{}", red); // OK, user-provided formatter
|
| 874 |
+
std::string s3 = std::format("{}", err{}); // error: disabled formatter
|
| 875 |
+
```
|
| 876 |
+
|
| 877 |
+
— *end example*]
|
| 878 |
+
|
| 879 |
+
#### Class template `basic_format_parse_context` <a id="format.parse.ctx">[[format.parse.ctx]]</a>
|
| 880 |
+
|
| 881 |
+
``` cpp
|
| 882 |
+
namespace std {
|
| 883 |
+
template<class charT>
|
| 884 |
+
class basic_format_parse_context {
|
| 885 |
+
public:
|
| 886 |
+
using char_type = charT;
|
| 887 |
+
using const_iterator = typename basic_string_view<charT>::const_iterator;
|
| 888 |
+
using iterator = const_iterator;
|
| 889 |
+
|
| 890 |
+
private:
|
| 891 |
+
iterator begin_; // exposition only
|
| 892 |
+
iterator end_; // exposition only
|
| 893 |
+
enum indexing { unknown, manual, automatic }; // exposition only
|
| 894 |
+
indexing indexing_; // exposition only
|
| 895 |
+
size_t next_arg_id_; // exposition only
|
| 896 |
+
size_t num_args_; // exposition only
|
| 897 |
+
|
| 898 |
+
public:
|
| 899 |
+
constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt,
|
| 900 |
+
size_t num_args = 0) noexcept;
|
| 901 |
+
basic_format_parse_context(const basic_format_parse_context&) = delete;
|
| 902 |
+
basic_format_parse_context& operator=(const basic_format_parse_context&) = delete;
|
| 903 |
+
|
| 904 |
+
constexpr const_iterator begin() const noexcept;
|
| 905 |
+
constexpr const_iterator end() const noexcept;
|
| 906 |
+
constexpr void advance_to(const_iterator it);
|
| 907 |
+
|
| 908 |
+
constexpr size_t next_arg_id();
|
| 909 |
+
constexpr void check_arg_id(size_t id);
|
| 910 |
+
};
|
| 911 |
+
}
|
| 912 |
+
```
|
| 913 |
+
|
| 914 |
+
An instance of `basic_format_parse_context` holds the format string
|
| 915 |
+
parsing state consisting of the format string range being parsed and the
|
| 916 |
+
argument counter for automatic indexing.
|
| 917 |
+
|
| 918 |
+
``` cpp
|
| 919 |
+
constexpr explicit basic_format_parse_context(basic_string_view<charT> fmt,
|
| 920 |
+
size_t num_args = 0) noexcept;
|
| 921 |
+
```
|
| 922 |
+
|
| 923 |
+
*Effects:* Initializes `begin_` with `fmt.begin()`, `end_` with
|
| 924 |
+
`fmt.end()`, `indexing_` with `unknown`, `next_arg_id_` with `0`, and
|
| 925 |
+
`num_args_` with `num_args`.
|
| 926 |
+
|
| 927 |
+
``` cpp
|
| 928 |
+
constexpr const_iterator begin() const noexcept;
|
| 929 |
+
```
|
| 930 |
+
|
| 931 |
+
*Returns:* `begin_`.
|
| 932 |
+
|
| 933 |
+
``` cpp
|
| 934 |
+
constexpr const_iterator end() const noexcept;
|
| 935 |
+
```
|
| 936 |
+
|
| 937 |
+
*Returns:* `end_`.
|
| 938 |
+
|
| 939 |
+
``` cpp
|
| 940 |
+
constexpr void advance_to(const_iterator it);
|
| 941 |
+
```
|
| 942 |
+
|
| 943 |
+
*Preconditions:* `end()` is reachable from `it`.
|
| 944 |
+
|
| 945 |
+
*Effects:* Equivalent to: `begin_ = it;`
|
| 946 |
+
|
| 947 |
+
``` cpp
|
| 948 |
+
constexpr size_t next_arg_id();
|
| 949 |
+
```
|
| 950 |
+
|
| 951 |
+
*Effects:* If `indexing_ != manual`, equivalent to:
|
| 952 |
+
|
| 953 |
+
``` cpp
|
| 954 |
+
if (indexing_ == unknown)
|
| 955 |
+
indexing_ = automatic;
|
| 956 |
+
return next_arg_id_++;
|
| 957 |
+
```
|
| 958 |
+
|
| 959 |
+
*Throws:* `format_error` if `indexing_ == manual` which indicates mixing
|
| 960 |
+
of automatic and manual argument indexing.
|
| 961 |
+
|
| 962 |
+
``` cpp
|
| 963 |
+
constexpr void check_arg_id(size_t id);
|
| 964 |
+
```
|
| 965 |
+
|
| 966 |
+
*Effects:* If `indexing_ != automatic`, equivalent to:
|
| 967 |
+
|
| 968 |
+
``` cpp
|
| 969 |
+
if (indexing_ == unknown)
|
| 970 |
+
indexing_ = manual;
|
| 971 |
+
```
|
| 972 |
+
|
| 973 |
+
*Throws:* `format_error` if `indexing_ == automatic` which indicates
|
| 974 |
+
mixing of automatic and manual argument indexing.
|
| 975 |
+
|
| 976 |
+
*Remarks:* Call expressions where `id >= num_args_` are not core
|
| 977 |
+
constant expressions [[expr.const]].
|
| 978 |
+
|
| 979 |
+
#### Class template `basic_format_context` <a id="format.context">[[format.context]]</a>
|
| 980 |
+
|
| 981 |
+
``` cpp
|
| 982 |
+
namespace std {
|
| 983 |
+
template<class Out, class charT>
|
| 984 |
+
class basic_format_context {
|
| 985 |
+
basic_format_args<basic_format_context> args_; // exposition only
|
| 986 |
+
Out out_; // exposition only
|
| 987 |
+
|
| 988 |
+
public:
|
| 989 |
+
using iterator = Out;
|
| 990 |
+
using char_type = charT;
|
| 991 |
+
template<class T> using formatter_type = formatter<T, charT>;
|
| 992 |
+
|
| 993 |
+
basic_format_arg<basic_format_context> arg(size_t id) const;
|
| 994 |
+
std::locale locale();
|
| 995 |
+
|
| 996 |
+
iterator out();
|
| 997 |
+
void advance_to(iterator it);
|
| 998 |
+
};
|
| 999 |
+
}
|
| 1000 |
+
```
|
| 1001 |
+
|
| 1002 |
+
An instance of `basic_format_context` holds formatting state consisting
|
| 1003 |
+
of the formatting arguments and the output iterator.
|
| 1004 |
+
|
| 1005 |
+
`Out` shall model `output_iterator<const charT&>`.
|
| 1006 |
+
|
| 1007 |
+
`format_context` is an alias for a specialization of
|
| 1008 |
+
`basic_format_context` with an output iterator that appends to `string`,
|
| 1009 |
+
such as `back_insert_iterator<string>`. Similarly, `wformat_context` is
|
| 1010 |
+
an alias for a specialization of `basic_format_context` with an output
|
| 1011 |
+
iterator that appends to `wstring`.
|
| 1012 |
+
|
| 1013 |
+
[*Note 1*: For a given type `charT`, implementations are encouraged to
|
| 1014 |
+
provide a single instantiation of `basic_format_context` for appending
|
| 1015 |
+
to `basic_string<charT>`, `vector<charT>`, or any other container with
|
| 1016 |
+
contiguous storage by wrapping those in temporary objects with a uniform
|
| 1017 |
+
interface (such as a `span<charT>`) and polymorphic
|
| 1018 |
+
reallocation. — *end note*]
|
| 1019 |
+
|
| 1020 |
+
``` cpp
|
| 1021 |
+
basic_format_arg<basic_format_context> arg(size_t id) const;
|
| 1022 |
+
```
|
| 1023 |
+
|
| 1024 |
+
*Returns:* `args_.get(id)`.
|
| 1025 |
+
|
| 1026 |
+
``` cpp
|
| 1027 |
+
std::locale locale();
|
| 1028 |
+
```
|
| 1029 |
+
|
| 1030 |
+
*Returns:* The locale passed to the formatting function if the latter
|
| 1031 |
+
takes one, and `std::locale()` otherwise.
|
| 1032 |
+
|
| 1033 |
+
``` cpp
|
| 1034 |
+
iterator out();
|
| 1035 |
+
```
|
| 1036 |
+
|
| 1037 |
+
*Returns:* `out_`.
|
| 1038 |
+
|
| 1039 |
+
``` cpp
|
| 1040 |
+
void advance_to(iterator it);
|
| 1041 |
+
```
|
| 1042 |
+
|
| 1043 |
+
*Effects:* Equivalent to: `out_ = it;`
|
| 1044 |
+
|
| 1045 |
+
[*Example 1*:
|
| 1046 |
+
|
| 1047 |
+
``` cpp
|
| 1048 |
+
struct S { int value; };
|
| 1049 |
+
|
| 1050 |
+
template<> struct std::formatter<S> {
|
| 1051 |
+
size_t width_arg_id = 0;
|
| 1052 |
+
|
| 1053 |
+
// Parses a width argument id in the format { digit }.
|
| 1054 |
+
constexpr auto parse(format_parse_context& ctx) {
|
| 1055 |
+
auto iter = ctx.begin();
|
| 1056 |
+
auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; };
|
| 1057 |
+
if (get_char() != '{')
|
| 1058 |
+
return iter;
|
| 1059 |
+
++iter;
|
| 1060 |
+
char c = get_char();
|
| 1061 |
+
if (!isdigit(c) || (++iter, get_char()) != '}')
|
| 1062 |
+
throw format_error("invalid format");
|
| 1063 |
+
width_arg_id = c - '0';
|
| 1064 |
+
ctx.check_arg_id(width_arg_id);
|
| 1065 |
+
return ++iter;
|
| 1066 |
+
}
|
| 1067 |
+
|
| 1068 |
+
// Formats an S with width given by the argument width_arg_id.
|
| 1069 |
+
auto format(S s, format_context& ctx) {
|
| 1070 |
+
int width = visit_format_arg([](auto value) -> int {
|
| 1071 |
+
if constexpr (!is_integral_v<decltype(value)>)
|
| 1072 |
+
throw format_error("width is not integral");
|
| 1073 |
+
else if (value < 0 || value > numeric_limits<int>::max())
|
| 1074 |
+
throw format_error("invalid width");
|
| 1075 |
+
else
|
| 1076 |
+
return value;
|
| 1077 |
+
}, ctx.arg(width_arg_id));
|
| 1078 |
+
return format_to(ctx.out(), "{0:x<{1}}", s.value, width);
|
| 1079 |
+
}
|
| 1080 |
+
};
|
| 1081 |
+
|
| 1082 |
+
std::string s = std::format("{0:{1}}", S{42}, 10); // value of s is "xxxxxxxx42"
|
| 1083 |
+
```
|
| 1084 |
+
|
| 1085 |
+
— *end example*]
|
| 1086 |
+
|
| 1087 |
+
### Arguments <a id="format.arguments">[[format.arguments]]</a>
|
| 1088 |
+
|
| 1089 |
+
#### Class template `basic_format_arg` <a id="format.arg">[[format.arg]]</a>
|
| 1090 |
+
|
| 1091 |
+
``` cpp
|
| 1092 |
+
namespace std {
|
| 1093 |
+
template<class Context>
|
| 1094 |
+
class basic_format_arg {
|
| 1095 |
+
public:
|
| 1096 |
+
class handle;
|
| 1097 |
+
|
| 1098 |
+
private:
|
| 1099 |
+
using char_type = typename Context::char_type; // exposition only
|
| 1100 |
+
|
| 1101 |
+
variant<monostate, bool, char_type,
|
| 1102 |
+
int, unsigned int, long long int, unsigned long long int,
|
| 1103 |
+
float, double, long double,
|
| 1104 |
+
const char_type*, basic_string_view<char_type>,
|
| 1105 |
+
const void*, handle> value; // exposition only
|
| 1106 |
+
|
| 1107 |
+
template<class T> explicit basic_format_arg(const T& v) noexcept; // exposition only
|
| 1108 |
+
explicit basic_format_arg(float n) noexcept; // exposition only
|
| 1109 |
+
explicit basic_format_arg(double n) noexcept; // exposition only
|
| 1110 |
+
explicit basic_format_arg(long double n) noexcept; // exposition only
|
| 1111 |
+
explicit basic_format_arg(const char_type* s); // exposition only
|
| 1112 |
+
|
| 1113 |
+
template<class traits>
|
| 1114 |
+
explicit basic_format_arg(
|
| 1115 |
+
basic_string_view<char_type, traits> s) noexcept; // exposition only
|
| 1116 |
+
|
| 1117 |
+
template<class traits, class Allocator>
|
| 1118 |
+
explicit basic_format_arg(
|
| 1119 |
+
const basic_string<char_type, traits, Allocator>& s) noexcept; // exposition only
|
| 1120 |
+
|
| 1121 |
+
explicit basic_format_arg(nullptr_t) noexcept; // exposition only
|
| 1122 |
+
|
| 1123 |
+
template<class T>
|
| 1124 |
+
explicit basic_format_arg(const T* p) noexcept; // exposition only
|
| 1125 |
+
|
| 1126 |
+
public:
|
| 1127 |
+
basic_format_arg() noexcept;
|
| 1128 |
+
|
| 1129 |
+
explicit operator bool() const noexcept;
|
| 1130 |
+
};
|
| 1131 |
+
}
|
| 1132 |
+
```
|
| 1133 |
+
|
| 1134 |
+
An instance of `basic_format_arg` provides access to a formatting
|
| 1135 |
+
argument for user-defined formatters.
|
| 1136 |
+
|
| 1137 |
+
The behavior of a program that adds specializations of
|
| 1138 |
+
`basic_format_arg` is undefined.
|
| 1139 |
+
|
| 1140 |
+
``` cpp
|
| 1141 |
+
basic_format_arg() noexcept;
|
| 1142 |
+
```
|
| 1143 |
+
|
| 1144 |
+
*Ensures:* `!(*this)`.
|
| 1145 |
+
|
| 1146 |
+
``` cpp
|
| 1147 |
+
template<class T> explicit basic_format_arg(const T& v) noexcept;
|
| 1148 |
+
```
|
| 1149 |
+
|
| 1150 |
+
*Constraints:* The template specialization
|
| 1151 |
+
|
| 1152 |
+
``` cpp
|
| 1153 |
+
typename Context::template formatter_type<T>
|
| 1154 |
+
```
|
| 1155 |
+
|
| 1156 |
+
meets the requirements [[formatter.requirements]]. The extent to which
|
| 1157 |
+
an implementation determines that the specialization meets the
|
| 1158 |
+
requirements is unspecified, except that as a minimum the expression
|
| 1159 |
+
|
| 1160 |
+
``` cpp
|
| 1161 |
+
typename Context::template formatter_type<T>()
|
| 1162 |
+
.format(declval<const T&>(), declval<Context&>())
|
| 1163 |
+
```
|
| 1164 |
+
|
| 1165 |
+
shall be well-formed when treated as an unevaluated operand.
|
| 1166 |
+
|
| 1167 |
+
*Effects:*
|
| 1168 |
+
|
| 1169 |
+
- if `T` is `bool` or `char_type`, initializes `value` with `v`;
|
| 1170 |
+
- otherwise, if `T` is `char` and `char_type` is `wchar_t`, initializes
|
| 1171 |
+
`value` with `static_cast<wchar_t>(v)`;
|
| 1172 |
+
- otherwise, if `T` is a signed integer type [[basic.fundamental]] and
|
| 1173 |
+
`sizeof(T) <= sizeof(int)`, initializes `value` with
|
| 1174 |
+
`static_cast<int>(v)`;
|
| 1175 |
+
- otherwise, if `T` is an unsigned integer type and
|
| 1176 |
+
`sizeof(T) <= sizeof(unsigned int)`, initializes `value` with
|
| 1177 |
+
`static_cast<unsigned int>(v)`;
|
| 1178 |
+
- otherwise, if `T` is a signed integer type and
|
| 1179 |
+
`sizeof(T) <= sizeof(long long int)`, initializes `value` with
|
| 1180 |
+
`static_cast<long long int>(v)`;
|
| 1181 |
+
- otherwise, if `T` is an unsigned integer type and
|
| 1182 |
+
`sizeof(T) <= sizeof(unsigned long long int)`, initializes `value`
|
| 1183 |
+
with `static_cast<unsigned long long int>(v)`;
|
| 1184 |
+
- otherwise, initializes `value` with `handle(v)`.
|
| 1185 |
+
|
| 1186 |
+
``` cpp
|
| 1187 |
+
explicit basic_format_arg(float n) noexcept;
|
| 1188 |
+
explicit basic_format_arg(double n) noexcept;
|
| 1189 |
+
explicit basic_format_arg(long double n) noexcept;
|
| 1190 |
+
```
|
| 1191 |
+
|
| 1192 |
+
*Effects:* Initializes `value` with `n`.
|
| 1193 |
+
|
| 1194 |
+
``` cpp
|
| 1195 |
+
explicit basic_format_arg(const char_type* s);
|
| 1196 |
+
```
|
| 1197 |
+
|
| 1198 |
+
*Preconditions:* `s` points to a NTCTS [[defns.ntcts]].
|
| 1199 |
+
|
| 1200 |
+
*Effects:* Initializes `value` with `s`.
|
| 1201 |
+
|
| 1202 |
+
``` cpp
|
| 1203 |
+
template<class traits>
|
| 1204 |
+
explicit basic_format_arg(basic_string_view<char_type, traits> s) noexcept;
|
| 1205 |
+
```
|
| 1206 |
+
|
| 1207 |
+
*Effects:* Initializes `value` with `s`.
|
| 1208 |
+
|
| 1209 |
+
``` cpp
|
| 1210 |
+
template<class traits, class Allocator>
|
| 1211 |
+
explicit basic_format_arg(
|
| 1212 |
+
const basic_string<char_type, traits, Allocator>& s) noexcept;
|
| 1213 |
+
```
|
| 1214 |
+
|
| 1215 |
+
*Effects:* Initializes `value` with
|
| 1216 |
+
`basic_string_view<char_type>(s.data(), s.size())`.
|
| 1217 |
+
|
| 1218 |
+
``` cpp
|
| 1219 |
+
explicit basic_format_arg(nullptr_t) noexcept;
|
| 1220 |
+
```
|
| 1221 |
+
|
| 1222 |
+
*Effects:* Initializes `value` with `static_cast<const void*>(nullptr)`.
|
| 1223 |
+
|
| 1224 |
+
``` cpp
|
| 1225 |
+
template<class T> explicit basic_format_arg(const T* p) noexcept;
|
| 1226 |
+
```
|
| 1227 |
+
|
| 1228 |
+
*Constraints:* `is_void_v<T>` is `true`.
|
| 1229 |
+
|
| 1230 |
+
*Effects:* Initializes `value` with `p`.
|
| 1231 |
+
|
| 1232 |
+
[*Note 1*: Constructing `basic_format_arg` from a pointer to a member
|
| 1233 |
+
is ill-formed unless the user provides an enabled specialization of
|
| 1234 |
+
`formatter` for that pointer to member type. — *end note*]
|
| 1235 |
+
|
| 1236 |
+
``` cpp
|
| 1237 |
+
explicit operator bool() const noexcept;
|
| 1238 |
+
```
|
| 1239 |
+
|
| 1240 |
+
*Returns:* `!holds_alternative<monostate>(value)`.
|
| 1241 |
+
|
| 1242 |
+
The class `handle` allows formatting an object of a user-defined type.
|
| 1243 |
+
|
| 1244 |
+
``` cpp
|
| 1245 |
+
namespace std {
|
| 1246 |
+
template<class Context>
|
| 1247 |
+
class basic_format_arg<Context>::handle {
|
| 1248 |
+
const void* ptr_; // exposition only
|
| 1249 |
+
void (*format_)(basic_format_parse_context<char_type>&,
|
| 1250 |
+
Context&, const void*); // exposition only
|
| 1251 |
+
|
| 1252 |
+
template<class T> explicit handle(const T& val) noexcept; // exposition only
|
| 1253 |
+
|
| 1254 |
+
friend class basic_format_arg<Context>; // exposition only
|
| 1255 |
+
|
| 1256 |
+
public:
|
| 1257 |
+
void format(basic_format_parse_context<char_type>&, Context& ctx) const;
|
| 1258 |
+
};
|
| 1259 |
+
}
|
| 1260 |
+
```
|
| 1261 |
+
|
| 1262 |
+
``` cpp
|
| 1263 |
+
template<class T> explicit handle(const T& val) noexcept;
|
| 1264 |
+
```
|
| 1265 |
+
|
| 1266 |
+
*Effects:* Initializes `ptr_` with `addressof(val)` and `format_` with
|
| 1267 |
+
|
| 1268 |
+
``` cpp
|
| 1269 |
+
[](basic_format_parse_context<char_type>& parse_ctx,
|
| 1270 |
+
Context& format_ctx, const void* ptr) {
|
| 1271 |
+
typename Context::template formatter_type<T> f;
|
| 1272 |
+
parse_ctx.advance_to(f.parse(parse_ctx));
|
| 1273 |
+
format_ctx.advance_to(f.format(*static_cast<const T*>(ptr), format_ctx));
|
| 1274 |
+
}
|
| 1275 |
+
```
|
| 1276 |
+
|
| 1277 |
+
``` cpp
|
| 1278 |
+
void format(basic_format_parse_context<char_type>& parse_ctx, Context& format_ctx) const;
|
| 1279 |
+
```
|
| 1280 |
+
|
| 1281 |
+
*Effects:* Equivalent to: `format_(parse_ctx, format_ctx, ptr_);`
|
| 1282 |
+
|
| 1283 |
+
``` cpp
|
| 1284 |
+
template<class Visitor, class Context>
|
| 1285 |
+
see below visit_format_arg(Visitor&& vis, basic_format_arg<Context> arg);
|
| 1286 |
+
```
|
| 1287 |
+
|
| 1288 |
+
*Effects:* Equivalent to:
|
| 1289 |
+
`return visit(forward<Visitor>(vis), arg.value);`
|
| 1290 |
+
|
| 1291 |
+
#### Class template *`format-arg-store`* <a id="format.arg.store">[[format.arg.store]]</a>
|
| 1292 |
+
|
| 1293 |
+
``` cpp
|
| 1294 |
+
namespace std {
|
| 1295 |
+
template<class Context, class... Args>
|
| 1296 |
+
struct format-arg-store { // exposition only
|
| 1297 |
+
array<basic_format_arg<Context>, sizeof...(Args)> args;
|
| 1298 |
+
};
|
| 1299 |
+
}
|
| 1300 |
+
```
|
| 1301 |
+
|
| 1302 |
+
An instance of *`format-arg-store`* stores formatting arguments.
|
| 1303 |
+
|
| 1304 |
+
``` cpp
|
| 1305 |
+
template<class Context = format_context, class... Args>
|
| 1306 |
+
format-arg-store<Context, Args...> make_format_args(const Args&... args);
|
| 1307 |
+
```
|
| 1308 |
+
|
| 1309 |
+
*Preconditions:* The type
|
| 1310 |
+
`typename Context::template formatter_type<``Tᵢ``>` meets the
|
| 1311 |
+
requirements [[formatter.requirements]] for each `Tᵢ` in `Args`.
|
| 1312 |
+
|
| 1313 |
+
*Returns:* `{basic_format_arg<Context>(args)...}`.
|
| 1314 |
+
|
| 1315 |
+
``` cpp
|
| 1316 |
+
template<class... Args>
|
| 1317 |
+
format-arg-store<wformat_context, Args...> make_wformat_args(const Args&... args);
|
| 1318 |
+
```
|
| 1319 |
+
|
| 1320 |
+
*Effects:* Equivalent to:
|
| 1321 |
+
`return make_format_args<wformat_context>(args...);`
|
| 1322 |
+
|
| 1323 |
+
#### Class template `basic_format_args` <a id="format.args">[[format.args]]</a>
|
| 1324 |
+
|
| 1325 |
+
``` cpp
|
| 1326 |
+
namespace std {
|
| 1327 |
+
template<class Context>
|
| 1328 |
+
class basic_format_args {
|
| 1329 |
+
size_t size_; // exposition only
|
| 1330 |
+
const basic_format_arg<Context>* data_; // exposition only
|
| 1331 |
+
|
| 1332 |
+
public:
|
| 1333 |
+
basic_format_args() noexcept;
|
| 1334 |
+
|
| 1335 |
+
template<class... Args>
|
| 1336 |
+
basic_format_args(const format-arg-store<Context, Args...>& store) noexcept;
|
| 1337 |
+
|
| 1338 |
+
basic_format_arg<Context> get(size_t i) const noexcept;
|
| 1339 |
+
};
|
| 1340 |
+
}
|
| 1341 |
+
```
|
| 1342 |
+
|
| 1343 |
+
An instance of `basic_format_args` provides access to formatting
|
| 1344 |
+
arguments.
|
| 1345 |
+
|
| 1346 |
+
``` cpp
|
| 1347 |
+
basic_format_args() noexcept;
|
| 1348 |
+
```
|
| 1349 |
+
|
| 1350 |
+
*Effects:* Initializes `size_` with `0`.
|
| 1351 |
+
|
| 1352 |
+
``` cpp
|
| 1353 |
+
template<class... Args>
|
| 1354 |
+
basic_format_args(const format-arg-store<Context, Args...>& store) noexcept;
|
| 1355 |
+
```
|
| 1356 |
+
|
| 1357 |
+
*Effects:* Initializes `size_` with `sizeof...(Args)` and `data_` with
|
| 1358 |
+
`store.args.data()`.
|
| 1359 |
+
|
| 1360 |
+
``` cpp
|
| 1361 |
+
basic_format_arg<Context> get(size_t i) const noexcept;
|
| 1362 |
+
```
|
| 1363 |
+
|
| 1364 |
+
*Returns:* `i < size_ ? data_[i] : basic_format_arg<Context>()`.
|
| 1365 |
+
|
| 1366 |
+
[*Note 1*: Implementations are encouraged to optimize the
|
| 1367 |
+
representation of `basic_format_args` for small number of formatting
|
| 1368 |
+
arguments by storing indices of type alternatives separately from values
|
| 1369 |
+
and packing the former. — *end note*]
|
| 1370 |
+
|
| 1371 |
+
### Class `format_error` <a id="format.error">[[format.error]]</a>
|
| 1372 |
+
|
| 1373 |
+
``` cpp
|
| 1374 |
+
namespace std {
|
| 1375 |
+
class format_error : public runtime_error {
|
| 1376 |
+
public:
|
| 1377 |
+
explicit format_error(const string& what_arg);
|
| 1378 |
+
explicit format_error(const char* what_arg);
|
| 1379 |
+
};
|
| 1380 |
+
}
|
| 1381 |
+
```
|
| 1382 |
+
|
| 1383 |
+
The class `format_error` defines the type of objects thrown as
|
| 1384 |
+
exceptions to report errors from the formatting library.
|
| 1385 |
+
|
| 1386 |
+
``` cpp
|
| 1387 |
+
format_error(const string& what_arg);
|
| 1388 |
+
```
|
| 1389 |
+
|
| 1390 |
+
*Ensures:* `strcmp(what(), what_arg.c_str()) == 0`.
|
| 1391 |
+
|
| 1392 |
+
``` cpp
|
| 1393 |
+
format_error(const char* what_arg);
|
| 1394 |
+
```
|
| 1395 |
+
|
| 1396 |
+
*Ensures:* `strcmp(what(), what_arg) == 0`.
|
| 1397 |
+
|
| 1398 |
+
<!-- Link reference definitions -->
|
| 1399 |
+
[alg.sorting]: algorithms.md#alg.sorting
|
| 1400 |
+
[algorithms]: algorithms.md#algorithms
|
| 1401 |
+
[algorithms.general]: algorithms.md#algorithms.general
|
| 1402 |
+
[algorithms.requirements]: algorithms.md#algorithms.requirements
|
| 1403 |
+
[allocator.adaptor]: #allocator.adaptor
|
| 1404 |
+
[allocator.adaptor.cnstr]: #allocator.adaptor.cnstr
|
| 1405 |
+
[allocator.adaptor.members]: #allocator.adaptor.members
|
| 1406 |
+
[allocator.adaptor.syn]: #allocator.adaptor.syn
|
| 1407 |
+
[allocator.adaptor.types]: #allocator.adaptor.types
|
| 1408 |
+
[allocator.globals]: #allocator.globals
|
| 1409 |
+
[allocator.members]: #allocator.members
|
| 1410 |
+
[allocator.requirements.completeness]: library.md#allocator.requirements.completeness
|
| 1411 |
+
[allocator.tag]: #allocator.tag
|
| 1412 |
+
[allocator.traits]: #allocator.traits
|
| 1413 |
+
[allocator.traits.members]: #allocator.traits.members
|
| 1414 |
+
[allocator.traits.types]: #allocator.traits.types
|
| 1415 |
+
[allocator.uses]: #allocator.uses
|
| 1416 |
+
[allocator.uses.construction]: #allocator.uses.construction
|
| 1417 |
+
[allocator.uses.trait]: #allocator.uses.trait
|
| 1418 |
+
[any]: #any
|
| 1419 |
+
[any.assign]: #any.assign
|
| 1420 |
+
[any.bad.any.cast]: #any.bad.any.cast
|
| 1421 |
+
[any.class]: #any.class
|
| 1422 |
+
[any.cons]: #any.cons
|
| 1423 |
+
[any.modifiers]: #any.modifiers
|
| 1424 |
+
[any.nonmembers]: #any.nonmembers
|
| 1425 |
+
[any.observers]: #any.observers
|
| 1426 |
+
[any.synop]: #any.synop
|
| 1427 |
+
[arithmetic.operations]: #arithmetic.operations
|
| 1428 |
+
[arithmetic.operations.divides]: #arithmetic.operations.divides
|
| 1429 |
+
[arithmetic.operations.minus]: #arithmetic.operations.minus
|
| 1430 |
+
[arithmetic.operations.modulus]: #arithmetic.operations.modulus
|
| 1431 |
+
[arithmetic.operations.multiplies]: #arithmetic.operations.multiplies
|
| 1432 |
+
[arithmetic.operations.negate]: #arithmetic.operations.negate
|
| 1433 |
+
[arithmetic.operations.plus]: #arithmetic.operations.plus
|
| 1434 |
+
[array]: containers.md#array
|
| 1435 |
+
[associative]: containers.md#associative
|
| 1436 |
+
[basic.align]: basic.md#basic.align
|
| 1437 |
+
[basic.compound]: basic.md#basic.compound
|
| 1438 |
+
[basic.def.odr]: basic.md#basic.def.odr
|
| 1439 |
+
[basic.fundamental]: basic.md#basic.fundamental
|
| 1440 |
+
[basic.life]: basic.md#basic.life
|
| 1441 |
+
[basic.stc.dynamic.allocation]: basic.md#basic.stc.dynamic.allocation
|
| 1442 |
+
[basic.stc.dynamic.safety]: basic.md#basic.stc.dynamic.safety
|
| 1443 |
+
[basic.types]: basic.md#basic.types
|
| 1444 |
+
[bitmask.types]: library.md#bitmask.types
|
| 1445 |
+
[bitset]: #bitset
|
| 1446 |
+
[bitset.cons]: #bitset.cons
|
| 1447 |
+
[bitset.hash]: #bitset.hash
|
| 1448 |
+
[bitset.members]: #bitset.members
|
| 1449 |
+
[bitset.operators]: #bitset.operators
|
| 1450 |
+
[bitset.syn]: #bitset.syn
|
| 1451 |
+
[bitwise.operations]: #bitwise.operations
|
| 1452 |
+
[bitwise.operations.and]: #bitwise.operations.and
|
| 1453 |
+
[bitwise.operations.not]: #bitwise.operations.not
|
| 1454 |
+
[bitwise.operations.or]: #bitwise.operations.or
|
| 1455 |
+
[bitwise.operations.xor]: #bitwise.operations.xor
|
| 1456 |
+
[c.malloc]: #c.malloc
|
| 1457 |
+
[charconv]: #charconv
|
| 1458 |
+
[charconv.from.chars]: #charconv.from.chars
|
| 1459 |
+
[charconv.syn]: #charconv.syn
|
| 1460 |
+
[charconv.to.chars]: #charconv.to.chars
|
| 1461 |
+
[class.copy.ctor]: class.md#class.copy.ctor
|
| 1462 |
+
[class.mem]: class.md#class.mem
|
| 1463 |
+
[comparisons]: #comparisons
|
| 1464 |
+
[comparisons.equal.to]: #comparisons.equal.to
|
| 1465 |
+
[comparisons.greater]: #comparisons.greater
|
| 1466 |
+
[comparisons.greater.equal]: #comparisons.greater.equal
|
| 1467 |
+
[comparisons.less]: #comparisons.less
|
| 1468 |
+
[comparisons.less.equal]: #comparisons.less.equal
|
| 1469 |
+
[comparisons.not.equal.to]: #comparisons.not.equal.to
|
| 1470 |
+
[comparisons.three.way]: #comparisons.three.way
|
| 1471 |
+
[concepts.equality]: concepts.md#concepts.equality
|
| 1472 |
+
[conv.array]: expr.md#conv.array
|
| 1473 |
+
[conv.func]: expr.md#conv.func
|
| 1474 |
+
[conv.lval]: expr.md#conv.lval
|
| 1475 |
+
[conv.qual]: expr.md#conv.qual
|
| 1476 |
+
[conv.rank]: basic.md#conv.rank
|
| 1477 |
+
[cpp17.allocator]: #cpp17.allocator
|
| 1478 |
+
[cpp17.copyassignable]: #cpp17.copyassignable
|
| 1479 |
+
[cpp17.copyconstructible]: #cpp17.copyconstructible
|
| 1480 |
+
[cpp17.defaultconstructible]: #cpp17.defaultconstructible
|
| 1481 |
+
[cpp17.destructible]: #cpp17.destructible
|
| 1482 |
+
[cpp17.hash]: #cpp17.hash
|
| 1483 |
+
[cpp17.moveassignable]: #cpp17.moveassignable
|
| 1484 |
+
[cpp17.moveconstructible]: #cpp17.moveconstructible
|
| 1485 |
+
[cpp17.nullablepointer]: #cpp17.nullablepointer
|
| 1486 |
+
[dcl.array]: dcl.md#dcl.array
|
| 1487 |
+
[dcl.constexpr]: dcl.md#dcl.constexpr
|
| 1488 |
+
[dcl.ref]: dcl.md#dcl.ref
|
| 1489 |
+
[declval]: #declval
|
| 1490 |
+
[default.allocator]: #default.allocator
|
| 1491 |
+
[defns.const.subexpr]: library.md#defns.const.subexpr
|
| 1492 |
+
[defns.expression-equivalent]: library.md#defns.expression-equivalent
|
| 1493 |
+
[defns.ntcts]: library.md#defns.ntcts
|
| 1494 |
+
[defns.order.ptr]: #defns.order.ptr
|
| 1495 |
+
[defns.referenceable]: library.md#defns.referenceable
|
| 1496 |
+
[execpol]: #execpol
|
| 1497 |
+
[execpol.general]: #execpol.general
|
| 1498 |
+
[execpol.objects]: #execpol.objects
|
| 1499 |
+
[execpol.par]: #execpol.par
|
| 1500 |
+
[execpol.parunseq]: #execpol.parunseq
|
| 1501 |
+
[execpol.seq]: #execpol.seq
|
| 1502 |
+
[execpol.type]: #execpol.type
|
| 1503 |
+
[execpol.unseq]: #execpol.unseq
|
| 1504 |
+
[execution.syn]: #execution.syn
|
| 1505 |
+
[expr.add]: expr.md#expr.add
|
| 1506 |
+
[expr.alignof]: expr.md#expr.alignof
|
| 1507 |
+
[expr.bit.and]: expr.md#expr.bit.and
|
| 1508 |
+
[expr.call]: expr.md#expr.call
|
| 1509 |
+
[expr.const]: expr.md#expr.const
|
| 1510 |
+
[expr.eq]: expr.md#expr.eq
|
| 1511 |
+
[expr.log.and]: expr.md#expr.log.and
|
| 1512 |
+
[expr.log.or]: expr.md#expr.log.or
|
| 1513 |
+
[expr.mul]: expr.md#expr.mul
|
| 1514 |
+
[expr.or]: expr.md#expr.or
|
| 1515 |
+
[expr.prop]: expr.md#expr.prop
|
| 1516 |
+
[expr.rel]: expr.md#expr.rel
|
| 1517 |
+
[expr.unary.op]: expr.md#expr.unary.op
|
| 1518 |
+
[expr.xor]: expr.md#expr.xor
|
| 1519 |
+
[format]: #format
|
| 1520 |
+
[format.align]: #format.align
|
| 1521 |
+
[format.arg]: #format.arg
|
| 1522 |
+
[format.arg.store]: #format.arg.store
|
| 1523 |
+
[format.args]: #format.args
|
| 1524 |
+
[format.arguments]: #format.arguments
|
| 1525 |
+
[format.context]: #format.context
|
| 1526 |
+
[format.err.report]: #format.err.report
|
| 1527 |
+
[format.error]: #format.error
|
| 1528 |
+
[format.formatter]: #format.formatter
|
| 1529 |
+
[format.formatter.spec]: #format.formatter.spec
|
| 1530 |
+
[format.functions]: #format.functions
|
| 1531 |
+
[format.parse.ctx]: #format.parse.ctx
|
| 1532 |
+
[format.sign]: #format.sign
|
| 1533 |
+
[format.string]: #format.string
|
| 1534 |
+
[format.string.general]: #format.string.general
|
| 1535 |
+
[format.string.std]: #format.string.std
|
| 1536 |
+
[format.syn]: #format.syn
|
| 1537 |
+
[format.type.bool]: #format.type.bool
|
| 1538 |
+
[format.type.char]: #format.type.char
|
| 1539 |
+
[format.type.float]: #format.type.float
|
| 1540 |
+
[format.type.int]: #format.type.int
|
| 1541 |
+
[format.type.ptr]: #format.type.ptr
|
| 1542 |
+
[format.type.string]: #format.type.string
|
| 1543 |
+
[formatter]: #formatter
|
| 1544 |
+
[formatter.requirements]: #formatter.requirements
|
| 1545 |
+
[forward]: #forward
|
| 1546 |
+
[func.bind]: #func.bind
|
| 1547 |
+
[func.bind.bind]: #func.bind.bind
|
| 1548 |
+
[func.bind.front]: #func.bind.front
|
| 1549 |
+
[func.bind.isbind]: #func.bind.isbind
|
| 1550 |
+
[func.bind.isplace]: #func.bind.isplace
|
| 1551 |
+
[func.bind.place]: #func.bind.place
|
| 1552 |
+
[func.def]: #func.def
|
| 1553 |
+
[func.identity]: #func.identity
|
| 1554 |
+
[func.invoke]: #func.invoke
|
| 1555 |
+
[func.memfn]: #func.memfn
|
| 1556 |
+
[func.not.fn]: #func.not.fn
|
| 1557 |
+
[func.require]: #func.require
|
| 1558 |
+
[func.search]: #func.search
|
| 1559 |
+
[func.search.bm]: #func.search.bm
|
| 1560 |
+
[func.search.bmh]: #func.search.bmh
|
| 1561 |
+
[func.search.default]: #func.search.default
|
| 1562 |
+
[func.wrap]: #func.wrap
|
| 1563 |
+
[func.wrap.badcall]: #func.wrap.badcall
|
| 1564 |
+
[func.wrap.func]: #func.wrap.func
|
| 1565 |
+
[func.wrap.func.alg]: #func.wrap.func.alg
|
| 1566 |
+
[func.wrap.func.cap]: #func.wrap.func.cap
|
| 1567 |
+
[func.wrap.func.con]: #func.wrap.func.con
|
| 1568 |
+
[func.wrap.func.inv]: #func.wrap.func.inv
|
| 1569 |
+
[func.wrap.func.mod]: #func.wrap.func.mod
|
| 1570 |
+
[func.wrap.func.nullptr]: #func.wrap.func.nullptr
|
| 1571 |
+
[func.wrap.func.targ]: #func.wrap.func.targ
|
| 1572 |
+
[function.objects]: #function.objects
|
| 1573 |
+
[functional.syn]: #functional.syn
|
| 1574 |
+
[intro.multithread]: basic.md#intro.multithread
|
| 1575 |
+
[intro.object]: basic.md#intro.object
|
| 1576 |
+
[intseq]: #intseq
|
| 1577 |
+
[intseq.general]: #intseq.general
|
| 1578 |
+
[intseq.intseq]: #intseq.intseq
|
| 1579 |
+
[intseq.make]: #intseq.make
|
| 1580 |
+
[invalid.argument]: diagnostics.md#invalid.argument
|
| 1581 |
+
[iostate.flags]: input.md#iostate.flags
|
| 1582 |
+
[istream.formatted]: input.md#istream.formatted
|
| 1583 |
+
[logical.operations]: #logical.operations
|
| 1584 |
+
[logical.operations.and]: #logical.operations.and
|
| 1585 |
+
[logical.operations.not]: #logical.operations.not
|
| 1586 |
+
[logical.operations.or]: #logical.operations.or
|
| 1587 |
+
[mem.poly.allocator.class]: #mem.poly.allocator.class
|
| 1588 |
+
[mem.poly.allocator.ctor]: #mem.poly.allocator.ctor
|
| 1589 |
+
[mem.poly.allocator.eq]: #mem.poly.allocator.eq
|
| 1590 |
+
[mem.poly.allocator.mem]: #mem.poly.allocator.mem
|
| 1591 |
+
[mem.res]: #mem.res
|
| 1592 |
+
[mem.res.class]: #mem.res.class
|
| 1593 |
+
[mem.res.eq]: #mem.res.eq
|
| 1594 |
+
[mem.res.global]: #mem.res.global
|
| 1595 |
+
[mem.res.monotonic.buffer]: #mem.res.monotonic.buffer
|
| 1596 |
+
[mem.res.monotonic.buffer.ctor]: #mem.res.monotonic.buffer.ctor
|
| 1597 |
+
[mem.res.monotonic.buffer.mem]: #mem.res.monotonic.buffer.mem
|
| 1598 |
+
[mem.res.pool]: #mem.res.pool
|
| 1599 |
+
[mem.res.pool.ctor]: #mem.res.pool.ctor
|
| 1600 |
+
[mem.res.pool.mem]: #mem.res.pool.mem
|
| 1601 |
+
[mem.res.pool.options]: #mem.res.pool.options
|
| 1602 |
+
[mem.res.pool.overview]: #mem.res.pool.overview
|
| 1603 |
+
[mem.res.private]: #mem.res.private
|
| 1604 |
+
[mem.res.public]: #mem.res.public
|
| 1605 |
+
[mem.res.syn]: #mem.res.syn
|
| 1606 |
+
[memory]: #memory
|
| 1607 |
+
[memory.general]: #memory.general
|
| 1608 |
+
[memory.syn]: #memory.syn
|
| 1609 |
+
[meta]: #meta
|
| 1610 |
+
[meta.const.eval]: #meta.const.eval
|
| 1611 |
+
[meta.help]: #meta.help
|
| 1612 |
+
[meta.logical]: #meta.logical
|
| 1613 |
+
[meta.member]: #meta.member
|
| 1614 |
+
[meta.rel]: #meta.rel
|
| 1615 |
+
[meta.rqmts]: #meta.rqmts
|
| 1616 |
+
[meta.trans]: #meta.trans
|
| 1617 |
+
[meta.trans.arr]: #meta.trans.arr
|
| 1618 |
+
[meta.trans.cv]: #meta.trans.cv
|
| 1619 |
+
[meta.trans.other]: #meta.trans.other
|
| 1620 |
+
[meta.trans.ptr]: #meta.trans.ptr
|
| 1621 |
+
[meta.trans.ref]: #meta.trans.ref
|
| 1622 |
+
[meta.trans.sign]: #meta.trans.sign
|
| 1623 |
+
[meta.type.synop]: #meta.type.synop
|
| 1624 |
+
[meta.unary]: #meta.unary
|
| 1625 |
+
[meta.unary.cat]: #meta.unary.cat
|
| 1626 |
+
[meta.unary.comp]: #meta.unary.comp
|
| 1627 |
+
[meta.unary.prop]: #meta.unary.prop
|
| 1628 |
+
[meta.unary.prop.query]: #meta.unary.prop.query
|
| 1629 |
+
[namespace.std]: library.md#namespace.std
|
| 1630 |
+
[new.delete]: support.md#new.delete
|
| 1631 |
+
[optional]: #optional
|
| 1632 |
+
[optional.assign]: #optional.assign
|
| 1633 |
+
[optional.assign.copy]: #optional.assign.copy
|
| 1634 |
+
[optional.assign.copy.templ]: #optional.assign.copy.templ
|
| 1635 |
+
[optional.assign.move]: #optional.assign.move
|
| 1636 |
+
[optional.assign.move.templ]: #optional.assign.move.templ
|
| 1637 |
+
[optional.bad.access]: #optional.bad.access
|
| 1638 |
+
[optional.comp.with.t]: #optional.comp.with.t
|
| 1639 |
+
[optional.ctor]: #optional.ctor
|
| 1640 |
+
[optional.dtor]: #optional.dtor
|
| 1641 |
+
[optional.general]: #optional.general
|
| 1642 |
+
[optional.hash]: #optional.hash
|
| 1643 |
+
[optional.mod]: #optional.mod
|
| 1644 |
+
[optional.nullops]: #optional.nullops
|
| 1645 |
+
[optional.nullopt]: #optional.nullopt
|
| 1646 |
+
[optional.observe]: #optional.observe
|
| 1647 |
+
[optional.optional]: #optional.optional
|
| 1648 |
+
[optional.relops]: #optional.relops
|
| 1649 |
+
[optional.specalg]: #optional.specalg
|
| 1650 |
+
[optional.swap]: #optional.swap
|
| 1651 |
+
[optional.syn]: #optional.syn
|
| 1652 |
+
[ostream.formatted]: input.md#ostream.formatted
|
| 1653 |
+
[out.of.range]: diagnostics.md#out.of.range
|
| 1654 |
+
[over.match.call]: over.md#over.match.call
|
| 1655 |
+
[over.match.class.deduct]: over.md#over.match.class.deduct
|
| 1656 |
+
[overflow.error]: diagnostics.md#overflow.error
|
| 1657 |
+
[pair.astuple]: #pair.astuple
|
| 1658 |
+
[pair.piecewise]: #pair.piecewise
|
| 1659 |
+
[pairs]: #pairs
|
| 1660 |
+
[pairs.general]: #pairs.general
|
| 1661 |
+
[pairs.pair]: #pairs.pair
|
| 1662 |
+
[pairs.spec]: #pairs.spec
|
| 1663 |
+
[pointer.conversion]: #pointer.conversion
|
| 1664 |
+
[pointer.traits]: #pointer.traits
|
| 1665 |
+
[pointer.traits.functions]: #pointer.traits.functions
|
| 1666 |
+
[pointer.traits.optmem]: #pointer.traits.optmem
|
| 1667 |
+
[pointer.traits.types]: #pointer.traits.types
|
| 1668 |
+
[ptr.align]: #ptr.align
|
| 1669 |
+
[range.cmp]: #range.cmp
|
| 1670 |
+
[ratio]: #ratio
|
| 1671 |
+
[ratio.arithmetic]: #ratio.arithmetic
|
| 1672 |
+
[ratio.comparison]: #ratio.comparison
|
| 1673 |
+
[ratio.general]: #ratio.general
|
| 1674 |
+
[ratio.ratio]: #ratio.ratio
|
| 1675 |
+
[ratio.si]: #ratio.si
|
| 1676 |
+
[ratio.syn]: #ratio.syn
|
| 1677 |
+
[refwrap]: #refwrap
|
| 1678 |
+
[refwrap.access]: #refwrap.access
|
| 1679 |
+
[refwrap.assign]: #refwrap.assign
|
| 1680 |
+
[refwrap.const]: #refwrap.const
|
| 1681 |
+
[refwrap.helpers]: #refwrap.helpers
|
| 1682 |
+
[refwrap.invoke]: #refwrap.invoke
|
| 1683 |
+
[res.on.exception.handling]: library.md#res.on.exception.handling
|
| 1684 |
+
[round.style]: support.md#round.style
|
| 1685 |
+
[scoped.adaptor.operators]: #scoped.adaptor.operators
|
| 1686 |
+
[smartptr]: #smartptr
|
| 1687 |
+
[special]: class.md#special
|
| 1688 |
+
[specialized.addressof]: #specialized.addressof
|
| 1689 |
+
[specialized.algorithms]: algorithms.md#specialized.algorithms
|
| 1690 |
+
[stmt.dcl]: stmt.md#stmt.dcl
|
| 1691 |
+
[stmt.return]: stmt.md#stmt.return
|
| 1692 |
+
[support.signal]: support.md#support.signal
|
| 1693 |
+
[swappable.requirements]: library.md#swappable.requirements
|
| 1694 |
+
[temp.deduct]: temp.md#temp.deduct
|
| 1695 |
+
[temp.param]: temp.md#temp.param
|
| 1696 |
+
[temp.type]: temp.md#temp.type
|
| 1697 |
+
[template.bitset]: #template.bitset
|
| 1698 |
+
[time.format]: time.md#time.format
|
| 1699 |
+
[tuple]: #tuple
|
| 1700 |
+
[tuple.apply]: #tuple.apply
|
| 1701 |
+
[tuple.assign]: #tuple.assign
|
| 1702 |
+
[tuple.cnstr]: #tuple.cnstr
|
| 1703 |
+
[tuple.creation]: #tuple.creation
|
| 1704 |
+
[tuple.elem]: #tuple.elem
|
| 1705 |
+
[tuple.general]: #tuple.general
|
| 1706 |
+
[tuple.helper]: #tuple.helper
|
| 1707 |
+
[tuple.rel]: #tuple.rel
|
| 1708 |
+
[tuple.special]: #tuple.special
|
| 1709 |
+
[tuple.swap]: #tuple.swap
|
| 1710 |
+
[tuple.syn]: #tuple.syn
|
| 1711 |
+
[tuple.traits]: #tuple.traits
|
| 1712 |
+
[tuple.tuple]: #tuple.tuple
|
| 1713 |
+
[type.index]: #type.index
|
| 1714 |
+
[type.index.hash]: #type.index.hash
|
| 1715 |
+
[type.index.members]: #type.index.members
|
| 1716 |
+
[type.index.overview]: #type.index.overview
|
| 1717 |
+
[type.index.synopsis]: #type.index.synopsis
|
| 1718 |
+
[unique.ptr]: #unique.ptr
|
| 1719 |
+
[unique.ptr.create]: #unique.ptr.create
|
| 1720 |
+
[unique.ptr.dltr]: #unique.ptr.dltr
|
| 1721 |
+
[unique.ptr.dltr.dflt]: #unique.ptr.dltr.dflt
|
| 1722 |
+
[unique.ptr.dltr.dflt1]: #unique.ptr.dltr.dflt1
|
| 1723 |
+
[unique.ptr.dltr.general]: #unique.ptr.dltr.general
|
| 1724 |
+
[unique.ptr.io]: #unique.ptr.io
|
| 1725 |
+
[unique.ptr.runtime]: #unique.ptr.runtime
|
| 1726 |
+
[unique.ptr.runtime.asgn]: #unique.ptr.runtime.asgn
|
| 1727 |
+
[unique.ptr.runtime.ctor]: #unique.ptr.runtime.ctor
|
| 1728 |
+
[unique.ptr.runtime.modifiers]: #unique.ptr.runtime.modifiers
|
| 1729 |
+
[unique.ptr.runtime.observers]: #unique.ptr.runtime.observers
|
| 1730 |
+
[unique.ptr.single]: #unique.ptr.single
|
| 1731 |
+
[unique.ptr.single.asgn]: #unique.ptr.single.asgn
|
| 1732 |
+
[unique.ptr.single.ctor]: #unique.ptr.single.ctor
|
| 1733 |
+
[unique.ptr.single.dtor]: #unique.ptr.single.dtor
|
| 1734 |
+
[unique.ptr.single.modifiers]: #unique.ptr.single.modifiers
|
| 1735 |
+
[unique.ptr.single.observers]: #unique.ptr.single.observers
|
| 1736 |
+
[unique.ptr.special]: #unique.ptr.special
|
| 1737 |
+
[unord]: containers.md#unord
|
| 1738 |
+
[unord.hash]: #unord.hash
|
| 1739 |
+
[util.dynamic.safety]: #util.dynamic.safety
|
| 1740 |
+
[util.smartptr.enab]: #util.smartptr.enab
|
| 1741 |
+
[util.smartptr.getdeleter]: #util.smartptr.getdeleter
|
| 1742 |
+
[util.smartptr.hash]: #util.smartptr.hash
|
| 1743 |
+
[util.smartptr.ownerless]: #util.smartptr.ownerless
|
| 1744 |
+
[util.smartptr.shared]: #util.smartptr.shared
|
| 1745 |
+
[util.smartptr.shared.assign]: #util.smartptr.shared.assign
|
| 1746 |
+
[util.smartptr.shared.cast]: #util.smartptr.shared.cast
|
| 1747 |
+
[util.smartptr.shared.cmp]: #util.smartptr.shared.cmp
|
| 1748 |
+
[util.smartptr.shared.const]: #util.smartptr.shared.const
|
| 1749 |
+
[util.smartptr.shared.create]: #util.smartptr.shared.create
|
| 1750 |
+
[util.smartptr.shared.dest]: #util.smartptr.shared.dest
|
| 1751 |
+
[util.smartptr.shared.io]: #util.smartptr.shared.io
|
| 1752 |
+
[util.smartptr.shared.mod]: #util.smartptr.shared.mod
|
| 1753 |
+
[util.smartptr.shared.obs]: #util.smartptr.shared.obs
|
| 1754 |
+
[util.smartptr.shared.spec]: #util.smartptr.shared.spec
|
| 1755 |
+
[util.smartptr.weak]: #util.smartptr.weak
|
| 1756 |
+
[util.smartptr.weak.assign]: #util.smartptr.weak.assign
|
| 1757 |
+
[util.smartptr.weak.bad]: #util.smartptr.weak.bad
|
| 1758 |
+
[util.smartptr.weak.const]: #util.smartptr.weak.const
|
| 1759 |
+
[util.smartptr.weak.dest]: #util.smartptr.weak.dest
|
| 1760 |
+
[util.smartptr.weak.mod]: #util.smartptr.weak.mod
|
| 1761 |
+
[util.smartptr.weak.obs]: #util.smartptr.weak.obs
|
| 1762 |
+
[util.smartptr.weak.spec]: #util.smartptr.weak.spec
|
| 1763 |
+
[utilities]: #utilities
|
| 1764 |
+
[utilities.general]: #utilities.general
|
| 1765 |
+
[utilities.summary]: #utilities.summary
|
| 1766 |
+
[utility]: #utility
|
| 1767 |
+
[utility.as.const]: #utility.as.const
|
| 1768 |
+
[utility.exchange]: #utility.exchange
|
| 1769 |
+
[utility.intcmp]: #utility.intcmp
|
| 1770 |
+
[utility.swap]: #utility.swap
|
| 1771 |
+
[utility.syn]: #utility.syn
|
| 1772 |
+
[variant]: #variant
|
| 1773 |
+
[variant.assign]: #variant.assign
|
| 1774 |
+
[variant.bad.access]: #variant.bad.access
|
| 1775 |
+
[variant.ctor]: #variant.ctor
|
| 1776 |
+
[variant.dtor]: #variant.dtor
|
| 1777 |
+
[variant.general]: #variant.general
|
| 1778 |
+
[variant.get]: #variant.get
|
| 1779 |
+
[variant.hash]: #variant.hash
|
| 1780 |
+
[variant.helper]: #variant.helper
|
| 1781 |
+
[variant.mod]: #variant.mod
|
| 1782 |
+
[variant.monostate]: #variant.monostate
|
| 1783 |
+
[variant.monostate.relops]: #variant.monostate.relops
|
| 1784 |
+
[variant.relops]: #variant.relops
|
| 1785 |
+
[variant.specalg]: #variant.specalg
|
| 1786 |
+
[variant.status]: #variant.status
|
| 1787 |
+
[variant.swap]: #variant.swap
|
| 1788 |
+
[variant.syn]: #variant.syn
|
| 1789 |
+
[variant.variant]: #variant.variant
|
| 1790 |
+
[variant.visit]: #variant.visit
|
| 1791 |
+
|
| 1792 |
+
[^1]: `pointer_safety::preferred` might be returned to indicate that a
|
| 1793 |
+
leak detector is running so that the program can avoid spurious leak
|
| 1794 |
+
reports.
|
| 1795 |
+
|
| 1796 |
+
[^2]: Such a type is a function pointer or a class type which has a
|
| 1797 |
+
member `operator()` or a class type which has a conversion to a
|
| 1798 |
+
pointer to function.
|