Created on 2019-08-02.00:00:00 last changed 4 months ago
This wording is relative to N4830.
Modify [format.string.std] as indicated:
-3- The meaning of the various alignment options is as specified in Table [tab:format.align]. [Example: […
[ 2020-02 Status to Immediate on Thursday night in Prague. ]
[ 2019-08-21; Victor Zverovich suggests wording ]
[ 2019-08-21 Priority set to 2 based on reflector discussion ]
We are told:
Formatting of objects of arithmetic types and const void* is done as if by calling to_chars (unless otherwise specified) and copying the output through the output iterator of the format context with additional padding and adjustments as specified by the format specifiers.
… but there is no corresponding rule for strings. Is an alignment specifier intended to be applied to strings or not? The wording as-is is ambiguous.(The above also doesn't cover formatting void* or std::nullptr_t. Presumably at least those two should have the relevant adjustments applied to them!) The wording never actually anywhere says that the basic_format_args are in any way involved in the formatting process, or how formatting actually happens. (The wording doesn't say that basic_format_arg::handle::format is ever called, for example.) Victor Zverovich: An alignment specifier is intended to be applied to strings as well, void* and std::nullptr_t are converted into const void* when constructing basic_format_arg. The wording for vformat and similar functions says that basic_format_args is involved:
Returns: A string object holding the character representation of formatting arguments provided by args formatted according to specifications given in fmt.
but I admit that it is hand-wavy. Perhaps we could add something along the lines of
For each replacement field referring to the argument with index (arg-id) i, the basic_format_arg object referring to the argument is obtained via args.get(i) and the parse and format functions of the formatter specialization for the underlying argument type are called to parse the format specification and format the value.
to clarify how we format args (basic_format_args).
|2020-02-24 16:02:59||admin||set||status: immediate -> wp|
|2020-02-14 09:37:04||admin||set||messages: + msg11106|
|2020-02-14 09:37:04||admin||set||status: new -> immediate|
|2019-08-21 19:16:09||admin||set||messages: + msg10576|
|2019-08-21 19:16:09||admin||set||messages: + msg10575|
|2019-08-21 19:09:21||admin||set||messages: + msg10574|