Created on 2021-09-05.00:00:00 last changed 36 months ago
Proposed resolution:
This wording is relative to N4892.
Modify [format.string.std], Table [tab:format.align], as indicated:
Table 59 — Meaning of align options [tab:format.align] Option Meaning < Forces the field to be aligned to the start of the available space. This is the default when the presentation type is a non-arithmetic type for non-arithmetic types, charT, and bool, unless an integer presentation type is specified.> Forces the field to be aligned to the end of the available space. This is the default when the presentation type is an arithmetic type for arithmetic types other than charT and bool or when an integer presentation type is specified.[…]
[ 2021-11-29; Daniel comments ]
This issue touches the same wording area as LWG 3644 does.
[ 2021-09-20; Reflector poll ]
Set priority to 2 after reflector poll.
Victor said "It mostly looks correct but I think the wording needs a bit more work because we don't mention arithmetic presentation types anywhere."
The alignment options specified in [format.string.std], Table [tab:format.align] causes an inconsistency when formatting characters. The output differs depending on whether an integer is formatted using a character presentation type or when using a character directly:
format("{:3}", '*'); -> "* " // aligned at the start of the available space format("{:3c}", 42); -> " *" // aligned at the end of the available space
I expect both calls to return the same value: "* ". The current wording mixes the type and the presentation type. To me, it seems clearer to adjust to wording to only use the presentation type. Another approach would be adjusting the wording to add an exception when an integer type uses the character presentation.
History | |||
---|---|---|---|
Date | User | Action | Args |
2021-11-29 17:25:00 | admin | set | messages: + msg12236 |
2021-09-20 11:22:03 | admin | set | messages: + msg12052 |
2021-09-05 16:05:49 | admin | set | messages: + msg12027 |
2021-09-05 00:00:00 | admin | create |