money_base::space and do_put: U+0020 versus fillSection: 28.3.4.7.4 [locale.moneypunct] Status: New Submitter: Hubert Tong Opened: 2016-04-12 Last modified: 2016-05-22
Priority: 3
View all other issues in [locale.moneypunct].
View all issues with New status.
Discussion:
The description of money_base::space is that "at least one space is required at that position."
(N4582 subclause 22.4.6.3 [locale.moneypunct] paragraph 2)
"the number of characters generated for the specified format" (excluding fill padding) includes exactly
one character for money_base::space (if present), and
all characters corresponding to money_base::space (excluding fill padding) are copies of fill.
In particular, there is implementation divergence over point (b) as to whether U+0020 or fill should be used.
Further, should a character other than fill be used, it is unclear when "the fill characters are
placed where none or space appears in the formatting pattern", whether the fill characters are placed
at the beginning or the end of the "space field".
fill is more likely
to be the pragmatic choice.
Proposed resolution:
This wording is relative to N4582.
Change 28.3.4.7.4 [locale.moneypunct] paragraph 2 as indicated:
-2- Where
noneorspaceappears, white space is permitted in the format, except wherenoneappears at the end, in which case no white space is permitted. For input, the valuespaceindicates that at least one space is required at that position. For output, the valuespaceindicates one instance of the fill character (28.3.4.7.3.3 [locale.money.put.virtuals]).The value. Wherespaceindicates that at least one space is required at that positionsymbolappears, the sequence of characters returned bycurr_symbol()is permitted, and can be required. Wheresignappears, the first (if any) of the sequence of characters returned bypositive_sign()ornegative_sign()(respectively as the monetary value is non-negative or negative) is required. Any remaining characters of the sign sequence are required after all other format components. Wherevalueappears, the absolute numeric monetary value is required.