money_base::space
and do_put
: U+0020 versus fill
Section: 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
none
orspace
appears, white space is permitted in the format, except wherenone
appears at the end, in which case no white space is permitted. For input, the valuespace
indicates that at least one space is required at that position. For output, the valuespace
indicates one instance of the fill character (28.3.4.7.3.3 [locale.money.put.virtuals]).The value. Wherespace
indicates that at least one space is required at that positionsymbol
appears, the sequence of characters returned bycurr_symbol()
is permitted, and can be required. Wheresign
appears, 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. Wherevalue
appears, the absolute numeric monetary value is required.