Title
money_base::space and do_put: U+0020 versus fill
Status
new
Section
[locale.moneypunct]
Submitter
Hubert Tong

Created on 2016-04-12.00:00:00 last changed 105 months ago

Messages

Date: 2016-05-06.18:12:17

Proposed resolution:

This wording is relative to N4582.

  1. Change [locale.moneypunct] paragraph 2 as indicated:

    -2- Where none or space appears, white space is permitted in the format, except where none appears at the end, in which case no white space is permitted. For input, the value space indicates that at least one space is required at that position. For output, the value space indicates one instance of the fill character ([locale.money.put.virtuals]).The value space indicates that at least one space is required at that position. Where symbol appears, the sequence of characters returned by curr_symbol() is permitted, and can be required. Where sign appears, the first (if any) of the sequence of characters returned by positive_sign() or negative_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. Where value appears, the absolute numeric monetary value is required.

Date: 2016-04-12.00:00:00

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)

When formatting for output ([locale.money.put.virtuals]), it is not clear that

  1. "the number of characters generated for the specified format" (excluding fill padding) includes exactly one character for money_base::space (if present), and

  2. 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".

I believe that a strict interpretation of the current wording supports U+0020; however, fill is more likely to be the pragmatic choice.

History
Date User Action Args
2016-05-06 18:12:17adminsetmessages: + msg8083
2016-04-12 00:00:00admincreate