From Jason Turner

[locale.moneypunct]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpr471erkq/{from.md → to.md} +49 -28
tmp/tmpr471erkq/{from.md → to.md} RENAMED
@@ -45,11 +45,11 @@ namespace std {
45
  ```
46
 
47
  The `moneypunct<>` facet defines monetary formatting parameters used by
48
  `money_get<>` and `money_put<>`. A monetary format is a sequence of four
49
  components, specified by a `pattern` value `p`, such that the `part`
50
- value `static_cast<part>(p.field[i])` determines the `i`th component of
51
  the format[^21] In the `field` member of a `pattern` object, each value
52
  `symbol`, `sign`, `value`, and either `space` or `none` appears exactly
53
  once. The value `none`, if present, is not first; the value `space`, if
54
  present, is neither first nor last.
55
 
@@ -65,44 +65,57 @@ required. Any remaining characters of the sign sequence are required
65
  after all other format components. Where `value` appears, the absolute
66
  numeric monetary value is required.
67
 
68
  The format of the numeric monetary value is a decimal number:
69
 
70
- ``` cpp
71
- value ::= units [ decimal-point [ digits ]] |
 
72
  decimal-point digits
73
  ```
74
 
 
 
 
 
 
75
  if `frac_digits()` returns a positive value, or
76
 
77
- ``` cpp
78
- value ::= units
 
79
  ```
80
 
81
- otherwise. The symbol `decimal-point` indicates the character returned
82
- by `decimal_point()`. The other symbols are defined as follows:
83
 
84
- ``` cpp
85
- units ::= digits [ thousands-sep units ]
86
- digits ::= adigit [ digits ]
 
87
  ```
88
 
89
- In the syntax specification, the symbol `adigit` is any of the values
90
- `ct.widen(c)` for `c` in the range `'0'` through `'9'`, inclusive, and
 
 
 
 
 
91
  `ct` is a reference of type `const ctype<charT>&` obtained as described
92
- in the definitions of `money_get<>` and `money_put<>`. The symbol
93
- `thousands-sep` is the character returned by `thousands_sep()`. The
94
- space character used is the value `ct.widen(' ')`. White space
95
- characters are those characters `c` for which `ci.is(space, c)` returns
96
- `true`. The number of digits required after the decimal point (if any)
97
- is exactly the value returned by `frac_digits()`.
98
 
99
  The placement of thousands-separator characters (if any) is determined
100
  by the value returned by `grouping()`, defined identically as the member
101
  `numpunct<>::do_grouping()`.
102
 
103
- ##### `moneypunct` members <a id="locale.moneypunct.members">[[locale.moneypunct.members]]</a>
104
 
105
  ``` cpp
106
  charT decimal_point() const;
107
  charT thousands_sep() const;
108
  string grouping() const;
@@ -115,11 +128,11 @@ pattern neg_format() const;
115
  ```
116
 
117
  Each of these functions `F` returns the result of calling the
118
  corresponding virtual member function `do_F()`.
119
 
120
- ##### `moneypunct` virtual functions <a id="locale.moneypunct.virtuals">[[locale.moneypunct.virtuals]]</a>
121
 
122
  ``` cpp
123
  charT do_decimal_point() const;
124
  ```
125
 
@@ -142,35 +155,43 @@ to, the result of `numpunct<charT>::do_grouping()`.[^24]
142
 
143
  ``` cpp
144
  string_type do_curr_symbol() const;
145
  ```
146
 
147
- *Returns:* A string to use as the currency identifier symbol.[^25]
 
 
 
 
148
 
149
  ``` cpp
150
  string_type do_positive_sign() const;
151
  string_type do_negative_sign() const;
152
  ```
153
 
154
  *Returns:* `do_positive_sign()` returns the string to use to indicate a
155
- positive monetary value;[^26] `do_negative_sign()` returns the string to
156
  use to indicate a negative value.
157
 
158
  ``` cpp
159
  int do_frac_digits() const;
160
  ```
161
 
162
  *Returns:* The number of digits after the decimal radix separator, if
163
- any.[^27]
164
 
165
  ``` cpp
166
  pattern do_pos_format() const;
167
  pattern do_neg_format() const;
168
  ```
169
 
170
  *Returns:* The specializations required in
171
- Table  [[tab:localization.required.specializations]] ([[locale.category]]),
172
- namely `moneypunct<char>`, `moneypunct<wchar_t>`,
173
- `moneypunct<char, true>`, and `moneypunct<wchar_t, true>`, return an
174
- object of type `pattern` initialized to
175
- `{ symbol, sign, none, value }`.[^28]
 
 
 
 
176
 
 
45
  ```
46
 
47
  The `moneypunct<>` facet defines monetary formatting parameters used by
48
  `money_get<>` and `money_put<>`. A monetary format is a sequence of four
49
  components, specified by a `pattern` value `p`, such that the `part`
50
+ value `static_cast<part>(p.field[i])` determines the `i`ᵗʰ component of
51
  the format[^21] In the `field` member of a `pattern` object, each value
52
  `symbol`, `sign`, `value`, and either `space` or `none` appears exactly
53
  once. The value `none`, if present, is not first; the value `space`, if
54
  present, is neither first nor last.
55
 
 
65
  after all other format components. Where `value` appears, the absolute
66
  numeric monetary value is required.
67
 
68
  The format of the numeric monetary value is a decimal number:
69
 
70
+ ``` bnf
71
+ value:
72
+ units fractionalₒₚₜ
73
  decimal-point digits
74
  ```
75
 
76
+ ``` bnf
77
+ fractional:
78
+ decimal-point digitsₒₚₜ
79
+ ```
80
+
81
  if `frac_digits()` returns a positive value, or
82
 
83
+ ``` bnf
84
+ value:
85
+ units
86
  ```
87
 
88
+ otherwise. The symbol indicates the character returned by
89
+ `decimal_point()`. The other symbols are defined as follows:
90
 
91
+ ``` bnf
92
+ units:
93
+ digits
94
+ digits thousands-sep units
95
  ```
96
 
97
+ ``` bnf
98
+ digits:
99
+ adigit digitsₒₚₜ
100
+ ```
101
+
102
+ In the syntax specification, the symbol is any of the values
103
+ `ct.widen(c)` for `c` in the range `'0'` through `'9'` (inclusive) and
104
  `ct` is a reference of type `const ctype<charT>&` obtained as described
105
+ in the definitions of `money_get<>` and `money_put<>`. The symbol is the
106
+ character returned by `thousands_sep()`. The space character used is the
107
+ value `ct.widen(' ')`. White space characters are those characters `c`
108
+ for which `ci.is(space, c)` returns `true`. The number of digits
109
+ required after the decimal point (if any) is exactly the value returned
110
+ by `frac_digits()`.
111
 
112
  The placement of thousands-separator characters (if any) is determined
113
  by the value returned by `grouping()`, defined identically as the member
114
  `numpunct<>::do_grouping()`.
115
 
116
+ ##### Members <a id="locale.moneypunct.members">[[locale.moneypunct.members]]</a>
117
 
118
  ``` cpp
119
  charT decimal_point() const;
120
  charT thousands_sep() const;
121
  string grouping() const;
 
128
  ```
129
 
130
  Each of these functions `F` returns the result of calling the
131
  corresponding virtual member function `do_F()`.
132
 
133
+ ##### Virtual functions <a id="locale.moneypunct.virtuals">[[locale.moneypunct.virtuals]]</a>
134
 
135
  ``` cpp
136
  charT do_decimal_point() const;
137
  ```
138
 
 
155
 
156
  ``` cpp
157
  string_type do_curr_symbol() const;
158
  ```
159
 
160
+ *Returns:* A string to use as the currency identifier symbol.
161
+
162
+ [*Note 1*: For specializations where the second template parameter is
163
+ `true`, this is typically four characters long: a three-letter code as
164
+ specified by ISO 4217 followed by a space. — *end note*]
165
 
166
  ``` cpp
167
  string_type do_positive_sign() const;
168
  string_type do_negative_sign() const;
169
  ```
170
 
171
  *Returns:* `do_positive_sign()` returns the string to use to indicate a
172
+ positive monetary value;[^25] `do_negative_sign()` returns the string to
173
  use to indicate a negative value.
174
 
175
  ``` cpp
176
  int do_frac_digits() const;
177
  ```
178
 
179
  *Returns:* The number of digits after the decimal radix separator, if
180
+ any.[^26]
181
 
182
  ``` cpp
183
  pattern do_pos_format() const;
184
  pattern do_neg_format() const;
185
  ```
186
 
187
  *Returns:* The specializations required in
188
+ [[locale.spec]][[locale.category]], namely
189
+
190
+ - `moneypunct<char>`,
191
+ - `moneypunct<wchar_t>`,
192
+ - `moneypunct<char, true>`, and
193
+ - `moneypunct<wchar_t, true>`,
194
+
195
+ return an object of type `pattern` initialized to
196
+ `{ symbol, sign, none, value }`.[^27]
197