tmp/tmpkbxglmaq/{from.md → to.md}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
### The monetary category <a id="category.monetary">[[category.monetary]]</a>
|
| 2 |
|
|
|
|
|
|
|
| 3 |
These templates handle monetary formats. A template parameter indicates
|
| 4 |
whether local or international monetary formats are to be used.
|
| 5 |
|
| 6 |
All specifications of member functions for `money_put` and `money_get`
|
| 7 |
in the subclauses of [[category.monetary]] only apply to the
|
|
@@ -118,11 +120,11 @@ the result is given a positive sign.
|
|
| 118 |
|
| 119 |
Digits in the numeric monetary component are extracted and placed in
|
| 120 |
`digits`, or into a character buffer `buf1` for conversion to produce a
|
| 121 |
value for `units`, in the order in which they appear, preceded by a
|
| 122 |
minus sign if and only if the result is negative. The value `units` is
|
| 123 |
-
produced as if by[^
|
| 124 |
|
| 125 |
``` cpp
|
| 126 |
for (int i = 0; i < n; ++i)
|
| 127 |
buf2[i] = src[find(atoms, atoms+sizeof(src), buf1[i]) - atoms];
|
| 128 |
buf2[n] = 0;
|
|
@@ -209,10 +211,13 @@ minus sign) in `digits` or `buf2`. In `digits`, only the optional
|
|
| 209 |
leading minus sign and the immediately subsequent digit characters (as
|
| 210 |
classified according to `ct`) are used; any trailing characters
|
| 211 |
(including digits appearing after a non-digit character) are ignored.
|
| 212 |
Calls `str.width(0)`.
|
| 213 |
|
|
|
|
|
|
|
|
|
|
| 214 |
*Remarks:* The currency symbol is generated if and only if
|
| 215 |
`(str.flags() & str.showbase)` is nonzero. If the number of characters
|
| 216 |
generated for the specified format is less than the value returned by
|
| 217 |
`str.width()` on entry to the function, then copies of `fill` are
|
| 218 |
inserted as necessary to pad to the specified width. For the value `af`
|
|
@@ -224,15 +229,14 @@ before the other characters.
|
|
| 224 |
|
| 225 |
[*Note 1*: It is possible, with some combinations of format patterns
|
| 226 |
and flag values, to produce output that cannot be parsed using
|
| 227 |
`num_get<>::get`. — *end note*]
|
| 228 |
|
| 229 |
-
*Returns:* An iterator pointing immediately after the last character
|
| 230 |
-
produced.
|
| 231 |
-
|
| 232 |
#### Class template `moneypunct` <a id="locale.moneypunct">[[locale.moneypunct]]</a>
|
| 233 |
|
|
|
|
|
|
|
| 234 |
``` cpp
|
| 235 |
namespace std {
|
| 236 |
class money_base {
|
| 237 |
public:
|
| 238 |
enum part { none, space, symbol, sign, value };
|
|
@@ -277,14 +281,16 @@ namespace std {
|
|
| 277 |
|
| 278 |
The `moneypunct<>` facet defines monetary formatting parameters used by
|
| 279 |
`money_get<>` and `money_put<>`. A monetary format is a sequence of four
|
| 280 |
components, specified by a `pattern` value `p`, such that the `part`
|
| 281 |
value `static_cast<part>(p.field[i])` determines the `i`ᵗʰ component of
|
| 282 |
-
the format[^
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
|
|
|
|
|
|
| 286 |
|
| 287 |
Where `none` or `space` appears, whitespace is permitted in the format,
|
| 288 |
except where `none` appears at the end, in which case no whitespace is
|
| 289 |
permitted. The value `space` indicates that at least one space is
|
| 290 |
required at that position. Where `symbol` appears, the sequence of
|
|
@@ -366,25 +372,25 @@ corresponding virtual member function `do_F()`.
|
|
| 366 |
``` cpp
|
| 367 |
charT do_decimal_point() const;
|
| 368 |
```
|
| 369 |
|
| 370 |
*Returns:* The radix separator to use in case `do_frac_digits()` is
|
| 371 |
-
greater than zero.[^
|
| 372 |
|
| 373 |
``` cpp
|
| 374 |
charT do_thousands_sep() const;
|
| 375 |
```
|
| 376 |
|
| 377 |
*Returns:* The digit group separator to use in case `do_grouping()`
|
| 378 |
-
specifies a digit grouping pattern.[^
|
| 379 |
|
| 380 |
``` cpp
|
| 381 |
string do_grouping() const;
|
| 382 |
```
|
| 383 |
|
| 384 |
*Returns:* A pattern defined identically as, but not necessarily equal
|
| 385 |
-
to, the result of `numpunct<charT>::do_grouping()`.[^
|
| 386 |
|
| 387 |
``` cpp
|
| 388 |
string_type do_curr_symbol() const;
|
| 389 |
```
|
| 390 |
|
|
@@ -398,19 +404,21 @@ specified by ISO 4217 followed by a space. — *end note*]
|
|
| 398 |
string_type do_positive_sign() const;
|
| 399 |
string_type do_negative_sign() const;
|
| 400 |
```
|
| 401 |
|
| 402 |
*Returns:* `do_positive_sign()` returns the string to use to indicate a
|
| 403 |
-
positive monetary value;[^
|
| 404 |
-
|
|
|
|
|
|
|
| 405 |
|
| 406 |
``` cpp
|
| 407 |
int do_frac_digits() const;
|
| 408 |
```
|
| 409 |
|
| 410 |
*Returns:* The number of digits after the decimal radix separator, if
|
| 411 |
-
any.[^
|
| 412 |
|
| 413 |
``` cpp
|
| 414 |
pattern do_pos_format() const;
|
| 415 |
pattern do_neg_format() const;
|
| 416 |
```
|
|
@@ -422,11 +430,11 @@ pattern do_neg_format() const;
|
|
| 422 |
- `moneypunct<wchar_t>`,
|
| 423 |
- `moneypunct<char, true>`, and
|
| 424 |
- `moneypunct<wchar_t, true>`,
|
| 425 |
|
| 426 |
return an object of type `pattern` initialized to
|
| 427 |
-
`{ symbol, sign, none, value }`.[^
|
| 428 |
|
| 429 |
#### Class template `moneypunct_byname` <a id="locale.moneypunct.byname">[[locale.moneypunct.byname]]</a>
|
| 430 |
|
| 431 |
``` cpp
|
| 432 |
namespace std {
|
|
|
|
| 1 |
### The monetary category <a id="category.monetary">[[category.monetary]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="category.monetary.general">[[category.monetary.general]]</a>
|
| 4 |
+
|
| 5 |
These templates handle monetary formats. A template parameter indicates
|
| 6 |
whether local or international monetary formats are to be used.
|
| 7 |
|
| 8 |
All specifications of member functions for `money_put` and `money_get`
|
| 9 |
in the subclauses of [[category.monetary]] only apply to the
|
|
|
|
| 120 |
|
| 121 |
Digits in the numeric monetary component are extracted and placed in
|
| 122 |
`digits`, or into a character buffer `buf1` for conversion to produce a
|
| 123 |
value for `units`, in the order in which they appear, preceded by a
|
| 124 |
minus sign if and only if the result is negative. The value `units` is
|
| 125 |
+
produced as if by[^18]
|
| 126 |
|
| 127 |
``` cpp
|
| 128 |
for (int i = 0; i < n; ++i)
|
| 129 |
buf2[i] = src[find(atoms, atoms+sizeof(src), buf1[i]) - atoms];
|
| 130 |
buf2[n] = 0;
|
|
|
|
| 211 |
leading minus sign and the immediately subsequent digit characters (as
|
| 212 |
classified according to `ct`) are used; any trailing characters
|
| 213 |
(including digits appearing after a non-digit character) are ignored.
|
| 214 |
Calls `str.width(0)`.
|
| 215 |
|
| 216 |
+
*Returns:* An iterator pointing immediately after the last character
|
| 217 |
+
produced.
|
| 218 |
+
|
| 219 |
*Remarks:* The currency symbol is generated if and only if
|
| 220 |
`(str.flags() & str.showbase)` is nonzero. If the number of characters
|
| 221 |
generated for the specified format is less than the value returned by
|
| 222 |
`str.width()` on entry to the function, then copies of `fill` are
|
| 223 |
inserted as necessary to pad to the specified width. For the value `af`
|
|
|
|
| 229 |
|
| 230 |
[*Note 1*: It is possible, with some combinations of format patterns
|
| 231 |
and flag values, to produce output that cannot be parsed using
|
| 232 |
`num_get<>::get`. — *end note*]
|
| 233 |
|
|
|
|
|
|
|
|
|
|
| 234 |
#### Class template `moneypunct` <a id="locale.moneypunct">[[locale.moneypunct]]</a>
|
| 235 |
|
| 236 |
+
##### General <a id="locale.moneypunct.general">[[locale.moneypunct.general]]</a>
|
| 237 |
+
|
| 238 |
``` cpp
|
| 239 |
namespace std {
|
| 240 |
class money_base {
|
| 241 |
public:
|
| 242 |
enum part { none, space, symbol, sign, value };
|
|
|
|
| 281 |
|
| 282 |
The `moneypunct<>` facet defines monetary formatting parameters used by
|
| 283 |
`money_get<>` and `money_put<>`. A monetary format is a sequence of four
|
| 284 |
components, specified by a `pattern` value `p`, such that the `part`
|
| 285 |
value `static_cast<part>(p.field[i])` determines the `i`ᵗʰ component of
|
| 286 |
+
the format[^19]
|
| 287 |
+
|
| 288 |
+
In the `field` member of a `pattern` object, each value `symbol`,
|
| 289 |
+
`sign`, `value`, and either `space` or `none` appears exactly once. The
|
| 290 |
+
value `none`, if present, is not first; the value `space`, if present,
|
| 291 |
+
is neither first nor last.
|
| 292 |
|
| 293 |
Where `none` or `space` appears, whitespace is permitted in the format,
|
| 294 |
except where `none` appears at the end, in which case no whitespace is
|
| 295 |
permitted. The value `space` indicates that at least one space is
|
| 296 |
required at that position. Where `symbol` appears, the sequence of
|
|
|
|
| 372 |
``` cpp
|
| 373 |
charT do_decimal_point() const;
|
| 374 |
```
|
| 375 |
|
| 376 |
*Returns:* The radix separator to use in case `do_frac_digits()` is
|
| 377 |
+
greater than zero.[^20]
|
| 378 |
|
| 379 |
``` cpp
|
| 380 |
charT do_thousands_sep() const;
|
| 381 |
```
|
| 382 |
|
| 383 |
*Returns:* The digit group separator to use in case `do_grouping()`
|
| 384 |
+
specifies a digit grouping pattern.[^21]
|
| 385 |
|
| 386 |
``` cpp
|
| 387 |
string do_grouping() const;
|
| 388 |
```
|
| 389 |
|
| 390 |
*Returns:* A pattern defined identically as, but not necessarily equal
|
| 391 |
+
to, the result of `numpunct<charT>::do_grouping()`.[^22]
|
| 392 |
|
| 393 |
``` cpp
|
| 394 |
string_type do_curr_symbol() const;
|
| 395 |
```
|
| 396 |
|
|
|
|
| 404 |
string_type do_positive_sign() const;
|
| 405 |
string_type do_negative_sign() const;
|
| 406 |
```
|
| 407 |
|
| 408 |
*Returns:* `do_positive_sign()` returns the string to use to indicate a
|
| 409 |
+
positive monetary value;[^23]
|
| 410 |
+
|
| 411 |
+
`do_negative_sign()` returns the string to use to indicate a negative
|
| 412 |
+
value.
|
| 413 |
|
| 414 |
``` cpp
|
| 415 |
int do_frac_digits() const;
|
| 416 |
```
|
| 417 |
|
| 418 |
*Returns:* The number of digits after the decimal radix separator, if
|
| 419 |
+
any.[^24]
|
| 420 |
|
| 421 |
``` cpp
|
| 422 |
pattern do_pos_format() const;
|
| 423 |
pattern do_neg_format() const;
|
| 424 |
```
|
|
|
|
| 430 |
- `moneypunct<wchar_t>`,
|
| 431 |
- `moneypunct<char, true>`, and
|
| 432 |
- `moneypunct<wchar_t, true>`,
|
| 433 |
|
| 434 |
return an object of type `pattern` initialized to
|
| 435 |
+
`{ symbol, sign, none, value }`.[^25]
|
| 436 |
|
| 437 |
#### Class template `moneypunct_byname` <a id="locale.moneypunct.byname">[[locale.moneypunct.byname]]</a>
|
| 438 |
|
| 439 |
``` cpp
|
| 440 |
namespace std {
|